aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-07-11 01:07:23 +0200
committerSven Gothel <[email protected]>2015-07-11 01:07:23 +0200
commit178194b7de4b4ad1de0c701356fca46565dde762 (patch)
tree5a7808629b763f67f84a86d9f4448b20cfee0473
parent83ea6a37435296758d492d8be594ca1fb54acdcb (diff)
cmake/clang: Keep using clang; OSX: -mmacosx-version-min=10.5; Inject additional architectures for fat-binary (macosx)
-rw-r--r--cmake/customconfig.clang-default.cmake21
-rw-r--r--cmake/customconfig.clang-x86_32.cmake16
2 files changed, 32 insertions, 5 deletions
diff --git a/cmake/customconfig.clang-default.cmake b/cmake/customconfig.clang-default.cmake
index 9f0f1b7c..bd6cada8 100644
--- a/cmake/customconfig.clang-default.cmake
+++ b/cmake/customconfig.clang-default.cmake
@@ -3,13 +3,28 @@
set(CMAKE_C_FLAGS "-include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h")
set(CMAKE_CXX_FLAGS "-include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h")
-set(CMAKE_CXX_CMPILER "gcc")
-set(CMAKE_C_CMPILER "gcc")
-set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags")
+if(APPLE)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.5")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5")
+endif()
+
+# inject additional architectures for fat-binary (macosx)
+# CMAKE_EXTRA_ARCHS is set from JOAL's ant build.xml
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_EXTRA_ARCHS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_EXTRA_ARCHS}")
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")
+
+message(STATUS "CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}")
+message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
+message(STATUS "CMAKE_C_FLAGS : ${CMAKE_C_FLAGS}")
+message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
# set(LINKER_FLAGS "-static-libgcc")
+message(STATUS "LINKER_FLAGS: ${LINKER_FLAGS}")
+
set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
diff --git a/cmake/customconfig.clang-x86_32.cmake b/cmake/customconfig.clang-x86_32.cmake
index fa3cf16e..a33e18b0 100644
--- a/cmake/customconfig.clang-x86_32.cmake
+++ b/cmake/customconfig.clang-x86_32.cmake
@@ -1,4 +1,4 @@
-# For multiarch gcc crosscompile, i.e. x86_32 target on x86_64 host
+# For multiarch clang crosscompile, i.e. x86_32 target on x86_64 host
set(CMAKE_SYSTEM_PROCESSOR "x86")
@@ -7,11 +7,23 @@ link_directories("/usr/lib32")
set(CMAKE_C_FLAGS "-m32 -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h")
set(CMAKE_CXX_FLAGS "-m32 -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h")
-set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags")
+if(APPLE)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.5")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5")
+endif()
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")
+message(STATUS "CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}")
+message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
+message(STATUS "CMAKE_C_FLAGS : ${CMAKE_C_FLAGS}")
+message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
+
# set(LINKER_FLAGS "-m32 -static-libgcc")
+message(STATUS "LINKER_FLAGS: ${LINKER_FLAGS}")
+
set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)