diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-20 08:37:21 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-20 08:40:13 +0200 |
commit | a4fb405d0d78adf2a97d828bc516ac9ee6cae77d (patch) | |
tree | 3c2075d60cebddc9f4ec4f21f5c3d667b79fc307 /cmake/apple.cmake | |
parent | d55a4b37629c5826adcf7cc3989913a10e9719ab (diff) |
cmake: add toolchain file for OSX
Diffstat (limited to 'cmake/apple.cmake')
-rw-r--r-- | cmake/apple.cmake | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cmake/apple.cmake b/cmake/apple.cmake new file mode 100644 index 00000000..c16ff575 --- /dev/null +++ b/cmake/apple.cmake @@ -0,0 +1,25 @@ +SET(CMAKE_SYSTEM_NAME Darwin) +SET(CMAKE_SYSTEM_VERSION 1) + +SET(CMAKE_C_COMPILER ${c}cc) +SET(CMAKE_CXX_COMPILER ${c}c++) +set(CMAKE_LINKER ${c}c++) + +set(CMAKE_OSX_ARCHITECTURES x86_64) +set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8) +# change this +set(CMAKE_OSX_SYSROOT /var/root/MacOSX10.8.sdk) + +# oldest CPU supported here is Northwood-based Pentium 4. -sh 20150811 +set(fpu "-fno-math-errno -funsafe-math-optimizations -fno-signed-zeros") +set(cpu "-O3 -DNDEBUG -flto ${fpu}") +set(cxx "-std=c++11 -stdlib=libc++") + +set(CFLAGS-OVERRIDE "" CACHE STRING "") + +set(CMAKE_C_FLAGS_RELEASE "${cpu} ${CFLAGS-OVERRIDE}" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${cxx}" CACHE STRING "" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${cpu} ${CFLAGS-OVERRIDE}" CACHE STRING "" FORCE) +set(CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} CACHE STRING "" FORCE) +set(CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} CACHE STRING "" FORCE) +set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE) |