dev: allow option to force compiling for apple silicon
Adding the optional switch to satisfy the following requirements - Desktop nim app requires to build for x86_64 - Desktop C++ app requires native support with Qt6.3+ The default is still forcing x86_64 builds on apple silicon
This commit is contained in:
parent
05073a9640
commit
23d745fe0a
|
@ -6,7 +6,7 @@ SET(LIB_SHARED_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/libstatus${CMAKE_SHARE
|
||||||
SET(LIB_HEADER_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/)
|
SET(LIB_HEADER_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/)
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${LIB_SHARED_FILE}
|
add_custom_command(OUTPUT ${LIB_SHARED_FILE}
|
||||||
COMMAND make statusgo-shared-library
|
COMMAND make FORCE_ARCH=${STATUSGO_FORCE_ARCH} statusgo-shared-library
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
add_custom_target(statusgo_shared_target DEPENDS ${LIB_SHARED_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
|
add_custom_target(statusgo_shared_target DEPENDS ${LIB_SHARED_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -16,9 +16,10 @@ endif
|
||||||
|
|
||||||
ifeq ($(detected_OS),Darwin)
|
ifeq ($(detected_OS),Darwin)
|
||||||
GOBIN_SHARED_LIB_EXT := dylib
|
GOBIN_SHARED_LIB_EXT := dylib
|
||||||
|
# Building on M1 is still not supported, so in the meantime we crosscompile by default to amd64
|
||||||
ifeq ("$(shell sysctl -nq hw.optional.arm64)","1")
|
ifeq ("$(shell sysctl -nq hw.optional.arm64)","1")
|
||||||
# Building on M1 is still not supported, so in the meantime we crosscompile to amd64
|
FORCE_ARCH ?= amd64
|
||||||
GOBIN_SHARED_LIB_CFLAGS=CGO_ENABLED=1 GOOS=darwin GOARCH=amd64
|
GOBIN_SHARED_LIB_CFLAGS=CGO_ENABLED=1 GOOS=darwin GOARCH=$(FORCE_ARCH)
|
||||||
endif
|
endif
|
||||||
else ifeq ($(detected_OS),Windows)
|
else ifeq ($(detected_OS),Windows)
|
||||||
GOBIN_SHARED_LIB_CGO_LDFLAGS := CGO_LDFLAGS=""
|
GOBIN_SHARED_LIB_CGO_LDFLAGS := CGO_LDFLAGS=""
|
||||||
|
|
Loading…
Reference in New Issue