File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
third_party/flatbuffers-c-bridge Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ scripts/tmp*
13
13
# Command built using `make build`
14
14
/objectbox-generator
15
15
/objectbox-generator.exe
16
+ build /
16
17
17
18
# CMake/C++ Examples:
18
19
examples /* /_deps
Original file line number Diff line number Diff line change @@ -14,10 +14,14 @@ all: depend build
14
14
# Link statically (except for Darwin)
15
15
ifneq ($(shell uname -s) ,Darwin)
16
16
BUILD_GO_LDFLAGS =-ldflags '-linkmode external -w -extldflags "-static"'
17
- endif
18
-
19
17
build : # # Build all targets
20
18
CGO_ENABLED=1 go build ${BUILD_GO_LDFLAGS} ./cmd/objectbox-generator/
19
+ else
20
+ build : # # Build universal binary (arm64, amd64)
21
+ CGO_ENABLED=1 GOARCH=arm64 go build -o build/objectbox-generator-arm64 ./cmd/objectbox-generator/
22
+ CGO_ENABLED=1 GOARCH=amd64 go build -o build/objectbox-generator-amd64 ./cmd/objectbox-generator/
23
+ lipo -create -output objectbox-generator build/objectbox-generator-arm64 build/objectbox-generator-amd64
24
+ endif
21
25
22
26
reinstall : build # # Update installed objectbox-generator
23
27
mv objectbox-generator " $( shell which objectbox-generator) "
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ if [[ "$(uname)" == MINGW* ]] || [[ "$(uname)" == CYGWIN* ]]; then
26
26
# buildOutputDir=/${buildType}
27
27
# buildArgs=
28
28
# buildArgs="-- /m" fails with "error MSB1008: Only one project can be specified."
29
+ elif [[ " $( uname) " == Darwin ]]; then # build universal binary
30
+ configArgs+=' -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"'
29
31
fi
30
32
31
33
function build() {
You can’t perform that action at this time.
0 commit comments