Skip to content

Commit 65294fe

Browse files
committed
Add macOS universal build for x86_64 and arm64 Apple M
1 parent 33a7a10 commit 65294fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ include_directories( ${Python_INCLUDE_DIRS} )
9595
# Shared libraries need flag -fPIC
9696
set_property( TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE TRUE )
9797

98-
# If macOS system, force mark all undefined symbols as having to be looked up at runtime
98+
# If macOS system, builds a Mach-O universal binary with 2 architectures: x86_64 and arm64 for Apple M processors
9999
if (APPLE)
100-
set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup" )
100+
set_property( TARGET ${PROJECT_NAME} PROPERTY COMPILE_FLAGS "-arch arm64 -arch x86_64" )
101+
set_property( TARGET ${PROJECT_NAME} PROPERTY LINK_FLAGS "-arch arm64 -arch x86_64" )
101102
endif()
102103

103104
# Add cPiCode library static link

0 commit comments

Comments
 (0)