From a71e2ed35cc57dfc9ca6d33c3a2b8a53b3659710 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 10 Jun 2014 19:14:45 +0200 Subject: CMake: Don't use CMAKE_TOOLCHAIN_FILE for non-crosscompilation, use OPENAL_CUSTOM_CONFIG to inject cmake commands --- CMakeLists.txt | 3 +++ cmake/customconfig.clang-default.cmake | 16 ++++++++++++++++ cmake/customconfig.clang-x86_32.cmake | 18 ++++++++++++++++++ cmake/customconfig.gcc-default.cmake | 14 ++++++++++++++ cmake/customconfig.gcc-x86_32.cmake | 18 ++++++++++++++++++ cmake/toolchain.clang-default.cmake | 14 -------------- cmake/toolchain.clang-x86_32.cmake | 18 ------------------ cmake/toolchain.gcc-default.cmake | 14 -------------- cmake/toolchain.gcc-x86_32.cmake | 18 ------------------ 9 files changed, 69 insertions(+), 64 deletions(-) create mode 100644 cmake/customconfig.clang-default.cmake create mode 100644 cmake/customconfig.clang-x86_32.cmake create mode 100644 cmake/customconfig.gcc-default.cmake create mode 100644 cmake/customconfig.gcc-x86_32.cmake delete mode 100644 cmake/toolchain.clang-default.cmake delete mode 100644 cmake/toolchain.clang-x86_32.cmake delete mode 100644 cmake/toolchain.gcc-default.cmake delete mode 100644 cmake/toolchain.gcc-x86_32.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 217c3d7e..cfbe30c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,9 @@ SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_REVISION}") SET(EXPORT_DECL "") SET(ALIGN_DECL "") +IF(OPENAL_CUSTOM_CONFIG) + include(${OPENAL_CUSTOM_CONFIG}) +ENDIF() CHECK_TYPE_SIZE("long" SIZEOF_LONG) CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) diff --git a/cmake/customconfig.clang-default.cmake b/cmake/customconfig.clang-default.cmake new file mode 100644 index 00000000..9f0f1b7c --- /dev/null +++ b/cmake/customconfig.clang-default.cmake @@ -0,0 +1,16 @@ +# For normal clang compilation + +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") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") + +# set(LINKER_FLAGS "-static-libgcc") + +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 new file mode 100644 index 00000000..fa3cf16e --- /dev/null +++ b/cmake/customconfig.clang-x86_32.cmake @@ -0,0 +1,18 @@ +# For multiarch gcc crosscompile, i.e. x86_32 target on x86_64 host + +set(CMAKE_SYSTEM_PROCESSOR "x86") + +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") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") + +# set(LINKER_FLAGS "-m32 -static-libgcc") + +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.gcc-default.cmake b/cmake/customconfig.gcc-default.cmake new file mode 100644 index 00000000..43294ab0 --- /dev/null +++ b/cmake/customconfig.gcc-default.cmake @@ -0,0 +1,14 @@ +# For normal gcc compilation, but use static-libgcc + +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_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") + +set(LINKER_FLAGS "-static-libgcc") + +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.gcc-x86_32.cmake b/cmake/customconfig.gcc-x86_32.cmake new file mode 100644 index 00000000..502378ab --- /dev/null +++ b/cmake/customconfig.gcc-x86_32.cmake @@ -0,0 +1,18 @@ +# For multiarch gcc crosscompile, i.e. x86_32 target on x86_64 host + +set(CMAKE_SYSTEM_PROCESSOR "x86") + +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") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") + +set(LINKER_FLAGS "-m32 -static-libgcc") + +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/toolchain.clang-default.cmake b/cmake/toolchain.clang-default.cmake deleted file mode 100644 index f38bf341..00000000 --- a/cmake/toolchain.clang-default.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# For normal clang compilation - -# 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_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") - -# set(LINKER_FLAGS "-static-libgcc") - -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/toolchain.clang-x86_32.cmake b/cmake/toolchain.clang-x86_32.cmake deleted file mode 100644 index cc76881a..00000000 --- a/cmake/toolchain.clang-x86_32.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# For multiarch gcc crosscompile, i.e. x86_32 target on x86_64 host - -set(CMAKE_SYSTEM_PROCESSOR "x86") - -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") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") - -# set(LINKER_FLAGS "-m32 -static-libgcc") - -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/toolchain.gcc-default.cmake b/cmake/toolchain.gcc-default.cmake deleted file mode 100644 index 43294ab0..00000000 --- a/cmake/toolchain.gcc-default.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# For normal gcc compilation, but use static-libgcc - -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_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") - -set(LINKER_FLAGS "-static-libgcc") - -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/toolchain.gcc-x86_32.cmake b/cmake/toolchain.gcc-x86_32.cmake deleted file mode 100644 index 502378ab..00000000 --- a/cmake/toolchain.gcc-x86_32.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# For multiarch gcc crosscompile, i.e. x86_32 target on x86_64 host - -set(CMAKE_SYSTEM_PROCESSOR "x86") - -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") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") - -set(LINKER_FLAGS "-m32 -static-libgcc") - -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) - -- cgit v1.2.3