summaryrefslogtreecommitdiffhomepage
path: root/cmake/apple.cmake
blob: 054e1ae5d9ca3bea00decef0bae766f714552272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)

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)