diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-19 12:20:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-19 12:20:15 +0200 |
commit | 6f836ab2ab0edb296e0dc3884983cf6b956fce68 (patch) | |
tree | c094ec62b1f445dae428050eaf0ca387afe2e4b0 | |
parent | 4b15c0e8d2579c3b52768c23639995e35295a1a7 (diff) | |
parent | cb26f1af8b6025d0e0a148e2661aa5bd057d6947 (diff) |
Merge pull request #1712 from matatata/apple_silicon
-rw-r--r-- | cmake/apple.cmake | 13 | ||||
-rw-r--r-- | gui/init.cpp | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/cmake/apple.cmake b/cmake/apple.cmake index f6b83382..64e4d628 100644 --- a/cmake/apple.cmake +++ b/cmake/apple.cmake @@ -1,12 +1,19 @@ set(CMAKE_BUILD_TYPE_INIT RELEASE) -set(CMAKE_CXX_FLAGS "-arch x86_64 -stdlib=libc++" CACHE STRING "" FORCE) -set(CMAKE_C_FLAGS "-arch x86_64" CACHE STRING "" FORCE) +if("$ENV{OTR_OSX_ARCH}" STREQUAL "arm64") + set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "" FORCE) + set(opentrack-intel FALSE) +else() + set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "" FORCE) + set(opentrack-intel TRUE) +endif() + +set(CMAKE_CXX_FLAGS "-stdlib=libc++" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELEASE "-ffast-math -O3 -flto -g" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELEASE " ${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE) -set(cmake-link-common "-stdlib=libc++ -arch x86_64") +set(cmake-link-common "-stdlib=libc++") set(CMAKE_EXE_LINKER_FLAGS "${cmake-link-common} -Wl,-stack_size,0x4000000" CACHE STRING "" FORCE) set(CMAKE_SHARED_LINKER_FLAGS ${cmake-link-common} CACHE STRING "" FORCE) set(CMAKE_MODULE_LINKER_FLAGS ${cmake-link-common} CACHE STRING "" FORCE) diff --git a/gui/init.cpp b/gui/init.cpp index 5984269c..b666b4a9 100644 --- a/gui/init.cpp +++ b/gui/init.cpp @@ -50,8 +50,10 @@ static void set_fp_mask() #endif #ifdef __APPLE__ +#if defined __i386__ || defined __x86_64__ fesetenv(FE_DFL_DISABLE_SSE_DENORMS_ENV); #endif +#endif #ifdef _WIN32 # ifdef __clang__ |