diff options
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Android-Clang.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Android-Determine.cmake | 5 | ||||
-rw-r--r-- | Modules/Platform/Apple-Intel.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/GHS-MULTI-Initialize.cmake | 60 | ||||
-rw-r--r-- | Modules/Platform/GNU.cmake | 27 | ||||
-rw-r--r-- | Modules/Platform/Generic-ADSP-C.cmake | 4 | ||||
-rw-r--r-- | Modules/Platform/Generic-ADSP-CXX.cmake | 4 | ||||
-rw-r--r-- | Modules/Platform/Generic-SDCC-C.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/Linux-Intel.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/Windows-Embarcadero.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Windows-Intel.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/WindowsPhone-Clang-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsPhone-Clang-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsPhone-GNU-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsPhone-GNU-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsStore-Clang-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsStore-Clang-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsStore-GNU-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/WindowsStore-GNU-CXX.cmake | 1 |
19 files changed, 90 insertions, 32 deletions
diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake index f739ab1..9ed1e01 100644 --- a/Modules/Platform/Android-Clang.cmake +++ b/Modules/Platform/Android-Clang.cmake @@ -40,5 +40,6 @@ macro(__android_compiler_clang lang) endif() if(NOT CMAKE_${lang}_COMPILER_TARGET) set(CMAKE_${lang}_COMPILER_TARGET "${_ANDROID_ABI_CLANG_TARGET}") + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}") endif() endmacro() diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index e623902..bb42eed 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -18,6 +18,9 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1) return() endif() +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST + # If the user provided CMAKE_SYSROOT for us, extract information from it. set(_ANDROID_SYSROOT_NDK "") set(_ANDROID_SYSROOT_API "") @@ -371,3 +374,5 @@ endif() # Report the chosen architecture. message(STATUS "Android: Targeting API '${CMAKE_SYSTEM_VERSION}' with architecture '${CMAKE_ANDROID_ARCH}', ABI '${CMAKE_ANDROID_ARCH_ABI}', and processor '${CMAKE_SYSTEM_PROCESSOR}'") + +cmake_policy(POP) diff --git a/Modules/Platform/Apple-Intel.cmake b/Modules/Platform/Apple-Intel.cmake index 2d4f7e5..a854be9 100644 --- a/Modules/Platform/Apple-Intel.cmake +++ b/Modules/Platform/Apple-Intel.cmake @@ -10,6 +10,9 @@ macro(__apple_compiler_intel lang) set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0) set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") endif() diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake index bf61d7b..9b384df 100644 --- a/Modules/Platform/GHS-MULTI-Initialize.cmake +++ b/Modules/Platform/GHS-MULTI-Initialize.cmake @@ -1,40 +1,44 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. +#Setup Green Hills MULTI specific compilation information -#Setup Greenhills MULTI specific compilation information - -if (NOT GHS_INT_DIRECTORY) - #Assume the C:/ghs/int#### directory that is latest is preferred - set(GHS_EXPECTED_ROOT "C:/ghs") - if (EXISTS ${GHS_EXPECTED_ROOT}) - FILE(GLOB GHS_CANDIDATE_INT_DIRS RELATIVE - ${GHS_EXPECTED_ROOT} ${GHS_EXPECTED_ROOT}/*) - string(REGEX MATCHALL "int[0-9][0-9][0-9][0-9a-z]" GHS_CANDIDATE_INT_DIRS - ${GHS_CANDIDATE_INT_DIRS}) - if (GHS_CANDIDATE_INT_DIRS) - list(SORT GHS_CANDIDATE_INT_DIRS) - list(GET GHS_CANDIDATE_INT_DIRS -1 GHS_INT_DIRECTORY) - string(CONCAT GHS_INT_DIRECTORY ${GHS_EXPECTED_ROOT} "/" - ${GHS_INT_DIRECTORY}) +set(GHS_OS_ROOT "C:/ghs" CACHE PATH "GHS platform OS search root directory") +mark_as_advanced(GHS_OS_ROOT) + +set(GHS_OS_DIR "NOTFOUND" CACHE PATH "GHS platform OS directory") +mark_as_advanced(GHS_OS_DIR) + +#set GHS_OS_DIR if not set by user +if ( NOT GHS_OS_DIR ) + if (EXISTS ${GHS_OS_ROOT}) + + #get all directories in root directory + FILE(GLOB GHS_CANDIDATE_OS_DIRS + LIST_DIRECTORIES true RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*) + FILE(GLOB GHS_CANDIDATE_OS_FILES + LIST_DIRECTORIES false RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*) + if ( GHS_CANDIDATE_OS_FILES ) + list(REMOVE_ITEM GHS_CANDIDATE_OS_DIRS ${GHS_CANDIDATE_OS_FILES}) endif () - endif () - #Try to look for known registry values - if (NOT GHS_INT_DIRECTORY) - find_path(GHS_INT_DIRECTORY INTEGRITY.ld PATHS - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware6433c345;InstallLocation]" #int1122 - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware289b6625;InstallLocation]" #int1104 - ) - endif () + #filter based on platform name + if (GHS_TARGET_PLATFORM STREQUAL "integrity") + list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z].*") + endif () + + if (GHS_CANDIDATE_OS_DIRS) + list(SORT GHS_CANDIDATE_OS_DIRS) + list(GET GHS_CANDIDATE_OS_DIRS -1 GHS_OS_DIR) + string(CONCAT GHS_OS_DIR ${GHS_OS_ROOT} "/" ${GHS_OS_DIR}) + endif() - set(GHS_INT_DIRECTORY ${GHS_INT_DIRECTORY} CACHE PATH - "Path to integrity directory") + set(GHS_OS_DIR "${GHS_OS_DIR}" CACHE PATH "GHS platform OS directory" FORCE) + endif () endif () -set(GHS_OS_DIR ${GHS_INT_DIRECTORY} CACHE PATH "OS directory") -set(GHS_PRIMARY_TARGET "arm_integrity.tgt" CACHE STRING "target for compilation") -set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name") +set(GHS_BSP_NAME "IGNORE" CACHE STRING "BSP name") + set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization") mark_as_advanced(GHS_CUSTOMIZATION) set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs for legacy reasons") diff --git a/Modules/Platform/GNU.cmake b/Modules/Platform/GNU.cmake index e8c3b65..fac29a8 100644 --- a/Modules/Platform/GNU.cmake +++ b/Modules/Platform/GNU.cmake @@ -8,6 +8,33 @@ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,") set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") +# Debian policy requires that shared libraries be installed without +# executable permission. Fedora policy requires that shared libraries +# be installed with the executable permission. Since the native tools +# create shared libraries with execute permission in the first place a +# reasonable policy seems to be to install with execute permission by +# default. In order to support debian packages we provide an option +# here. The option default is based on the current distribution, but +# packagers can set it explicitly on the command line. +if(DEFINED CMAKE_INSTALL_SO_NO_EXE) + # Store the decision variable in the cache. This preserves any + # setting the user provides on the command line. + set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL + "Install .so files without execute permission.") +else() + # Store the decision variable as an internal cache entry to avoid + # checking the platform every time. This option is advanced enough + # that only package maintainers should need to adjust it. They are + # capable of providing a setting on the command line. + if(EXISTS "/etc/debian_version") + set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL + "Install .so files without execute permission.") + else() + set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL + "Install .so files without execute permission.") + endif() +endif() + set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*") include(Platform/UnixPaths) diff --git a/Modules/Platform/Generic-ADSP-C.cmake b/Modules/Platform/Generic-ADSP-C.cmake index de1cee2..c8597cd 100644 --- a/Modules/Platform/Generic-ADSP-C.cmake +++ b/Modules/Platform/Generic-ADSP-C.cmake @@ -9,6 +9,9 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " ") string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ") string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " ") +set(CMAKE_C_LINKER_WRAPPER_FLAG "-flags-link" " ") +set(CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",") + set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_C_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_C_LINK_FLAGS> <OBJECTS>") @@ -17,4 +20,3 @@ set(CMAKE_C_LINK_EXECUTABLE set(CMAKE_C_CREATE_SHARED_LIBRARY) set(CMAKE_C_CREATE_MODULE_LIBRARY) - diff --git a/Modules/Platform/Generic-ADSP-CXX.cmake b/Modules/Platform/Generic-ADSP-CXX.cmake index 0cde8f2..d76bb66 100644 --- a/Modules/Platform/Generic-ADSP-CXX.cmake +++ b/Modules/Platform/Generic-ADSP-CXX.cmake @@ -7,6 +7,9 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " ") string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ") string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " ") +set(CMAKE_CXX_LINKER_WRAPPER_FLAG "-flags-link" " ") +set(CMAKE_CXX_LINKER_WRAPPER_FLAG_SEP ",") + set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_CXX_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_CXX_LINK_FLAGS> <OBJECTS>") @@ -15,4 +18,3 @@ set(CMAKE_CXX_LINK_EXECUTABLE set(CMAKE_CXX_CREATE_SHARED_LIBRARY) set(CMAKE_CXX_CREATE_MODULE_LIBRARY) - diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake index 4b3912a..aef4abf 100644 --- a/Modules/Platform/Generic-SDCC-C.cmake +++ b/Modules/Platform/Generic-SDCC-C.cmake @@ -37,6 +37,8 @@ if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) set (CMAKE_EXE_LINKER_FLAGS_INIT --model-small) endif() +set(CMAKE_C_LINKER_WRAPPER_FLAG "-Wl" ",") + # compile a C file into an object file set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") @@ -51,4 +53,3 @@ set(CMAKE_C_CREATE_STATIC_LIBRARY # not supported by sdcc set(CMAKE_C_CREATE_SHARED_LIBRARY "") set(CMAKE_C_CREATE_MODULE_LIBRARY "") - diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index ee9aac2..f712e2b 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -30,6 +30,9 @@ macro(__linux_compiler_intel lang) # executables that use dlopen but do not set ENABLE_EXPORTS. set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES) if(XIAR) diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake index f8e1c9e..48b936e 100644 --- a/Modules/Platform/Windows-Embarcadero.cmake +++ b/Modules/Platform/Windows-Embarcadero.cmake @@ -76,6 +76,8 @@ macro(__embarcadero_language lang) set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}") # ... while this is a space separated string. set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1) + set (CMAKE_${lang}_LINKER_WRAPPER_FLAG "-l") + # compile a source file into an object file # place <DEFINES> outside the response file because Borland refuses # to parse quotes from the response file. diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake index ba31001..96b1760 100644 --- a/Modules/Platform/Windows-Intel.cmake +++ b/Modules/Platform/Windows-Intel.cmake @@ -11,7 +11,7 @@ set(__WINDOWS_INTEL 1) include(Platform/Windows-MSVC) macro(__windows_compiler_intel lang) __windows_compiler_msvc(${lang}) - string(REPLACE "<CMAKE_LINKER> /lib" "lib" CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_${lang}_CREATE_STATIC_LIBRARY}") + string(REPLACE "<CMAKE_LINKER> /lib" "xilib" CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_${lang}_CREATE_STATIC_LIBRARY}") foreach(rule CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE) string(REPLACE "<CMAKE_LINKER>" "xilink" CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}") endforeach() diff --git a/Modules/Platform/WindowsPhone-Clang-C.cmake b/Modules/Platform/WindowsPhone-Clang-C.cmake new file mode 100644 index 0000000..6e38572 --- /dev/null +++ b/Modules/Platform/WindowsPhone-Clang-C.cmake @@ -0,0 +1 @@ +include(Platform/Windows-Clang-C) diff --git a/Modules/Platform/WindowsPhone-Clang-CXX.cmake b/Modules/Platform/WindowsPhone-Clang-CXX.cmake new file mode 100644 index 0000000..bf47978 --- /dev/null +++ b/Modules/Platform/WindowsPhone-Clang-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Windows-Clang-CXX) diff --git a/Modules/Platform/WindowsPhone-GNU-C.cmake b/Modules/Platform/WindowsPhone-GNU-C.cmake new file mode 100644 index 0000000..ff6acd5 --- /dev/null +++ b/Modules/Platform/WindowsPhone-GNU-C.cmake @@ -0,0 +1 @@ +include(Platform/Windows-GNU-C) diff --git a/Modules/Platform/WindowsPhone-GNU-CXX.cmake b/Modules/Platform/WindowsPhone-GNU-CXX.cmake new file mode 100644 index 0000000..6adab6a --- /dev/null +++ b/Modules/Platform/WindowsPhone-GNU-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Windows-GNU-CXX) diff --git a/Modules/Platform/WindowsStore-Clang-C.cmake b/Modules/Platform/WindowsStore-Clang-C.cmake new file mode 100644 index 0000000..6e38572 --- /dev/null +++ b/Modules/Platform/WindowsStore-Clang-C.cmake @@ -0,0 +1 @@ +include(Platform/Windows-Clang-C) diff --git a/Modules/Platform/WindowsStore-Clang-CXX.cmake b/Modules/Platform/WindowsStore-Clang-CXX.cmake new file mode 100644 index 0000000..bf47978 --- /dev/null +++ b/Modules/Platform/WindowsStore-Clang-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Windows-Clang-CXX) diff --git a/Modules/Platform/WindowsStore-GNU-C.cmake b/Modules/Platform/WindowsStore-GNU-C.cmake new file mode 100644 index 0000000..ff6acd5 --- /dev/null +++ b/Modules/Platform/WindowsStore-GNU-C.cmake @@ -0,0 +1 @@ +include(Platform/Windows-GNU-C) diff --git a/Modules/Platform/WindowsStore-GNU-CXX.cmake b/Modules/Platform/WindowsStore-GNU-CXX.cmake new file mode 100644 index 0000000..6adab6a --- /dev/null +++ b/Modules/Platform/WindowsStore-GNU-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Windows-GNU-CXX) |