Skip to content

Commit

Permalink
Build only for Intel when compiling on an ARM Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
William Kent committed May 26, 2022
1 parent adaeb74 commit 877c5b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/crosscompile.cmake
Expand Up @@ -9,6 +9,7 @@ function(add_darwin_executable name)
if(NOT SL_USE_HOST_SDK)
target_compile_options(${name} PRIVATE -nostdlib -nostdinc)
target_link_options(${name} PRIVATE -nostdlib)
set_property(TARGET ${name} PROPERTY OSX_ARCHITECTURES x86_64)
endif()

# TODO: Handle SL_NO_STANDARD_LIBRARIES here, once the libraries have been added to the build.
Expand Down Expand Up @@ -48,6 +49,7 @@ function(add_darwin_static_library name)

if(NOT SL_USE_HOST_SDK)
target_compile_options(${name} PRIVATE -nostdlib -nostdinc)
set_property(TARGET ${name} PROPERTY OSX_ARCHITECTURES x86_64)
endif()
endfunction()

Expand All @@ -72,6 +74,8 @@ function(add_darwin_shared_library name)
if(NOT SL_USE_HOST_SDK)
target_compile_options(${name} PRIVATE -nostdlib -nostdinc)
target_link_options(${name} PRIVATE -nostdlib)

set_property(TARGET ${name} PROPERTY OSX_ARCHITECTURES x86_64)
endif()

if(SL_MACOSX_VERSION_MIN)
Expand Down Expand Up @@ -120,6 +124,7 @@ function(add_darwin_object_library name)

if(NOT SL_USE_HOST_SDK)
target_compile_options(${name} PRIVATE -nostdlib -nostdinc)
set_property(TARGET ${name} PROPERTY OSX_ARCHITECTURES x86_64)
endif()
endfunction()

Expand Down

0 comments on commit 877c5b3

Please sign in to comment.