diff options
author | Brad King <brad.king@kitware.com> | 2020-07-15 10:48:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-07-15 10:48:37 (GMT) |
commit | e169ec9c23b5fda1d0036e8e3dadec635111ff90 (patch) | |
tree | 738591befee17f0f6291e9ba8860ba8cde7f7c6a /Modules | |
parent | 2d294219a5e8388b68bf2bec77946ce3477ba2c7 (diff) | |
parent | 98fea8205e4a5251871edafba427fd7d100e5db9 (diff) | |
download | CMake-e169ec9c23b5fda1d0036e8e3dadec635111ff90.zip CMake-e169ec9c23b5fda1d0036e8e3dadec635111ff90.tar.gz CMake-e169ec9c23b5fda1d0036e8e3dadec635111ff90.tar.bz2 |
Merge topic 'compi-ti-improvements'
98fea8205e Compiler/TI: Avoid response file usage for linker
5dec322f33 Compiler/TI: Add compiler flags to linker
763b44e519 Compiler/TI: Avoid usage of ranlib
ef528f10bf Compiler/TI: Sync ASM settings to C/CXX
a548a52230 Compiler/TI: Refactor C/CXX to use a common file
195aa488e3 Compiler/TI: Detect architecture
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5010
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakePlatformId.h.in | 19 | ||||
-rw-r--r-- | Modules/Compiler/TI-ASM.cmake | 8 | ||||
-rw-r--r-- | Modules/Compiler/TI-C.cmake | 18 | ||||
-rw-r--r-- | Modules/Compiler/TI-CXX.cmake | 17 | ||||
-rw-r--r-- | Modules/Compiler/TI.cmake | 40 |
5 files changed, 64 insertions, 38 deletions
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index 40668a3..0b81c88 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -206,6 +206,24 @@ # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + #else # define ARCHITECTURE_ID #endif @@ -283,4 +301,3 @@ char const info_simulate_version[] = { array rather than assigning a pointer to a static array. */ char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - diff --git a/Modules/Compiler/TI-ASM.cmake b/Modules/Compiler/TI-ASM.cmake index a566d70..01965d2 100644 --- a/Modules/Compiler/TI-ASM.cmake +++ b/Modules/Compiler/TI-ASM.cmake @@ -1,8 +1,4 @@ -set(CMAKE_LIBRARY_PATH_FLAG "--search_path=") -set(CMAKE_LINK_LIBRARY_FLAG "--library=") -set(CMAKE_INCLUDE_FLAG_ASM "--include_path=") - -set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> --compile_only --asm_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>") -set(CMAKE_ASM_LINK_EXECUTABLE "<CMAKE_ASM_COMPILER> <OBJECTS> --run_linker --output_file=<TARGET> <CMAKE_ASM_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>") +include(Compiler/TI) +__compiler_ti(ASM) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm;s;abs) diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake index b060ee9..8ea01b5 100644 --- a/Modules/Compiler/TI-C.cmake +++ b/Modules/Compiler/TI-C.cmake @@ -1,22 +1,8 @@ -set(CMAKE_LIBRARY_PATH_FLAG "--search_path=") -set(CMAKE_LINK_LIBRARY_FLAG "--library=") -set(CMAKE_INCLUDE_FLAG_C "--include_path=") +include(Compiler/TI) +__compiler_ti(C) set(CMAKE_C90_STANDARD_COMPILE_OPTION "--c89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--c89 --relaxed_ansi") set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99") set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99 --relaxed_ansi") - -set(CMAKE_DEPFILE_FLAGS_C "--preproc_with_compile --preproc_dependency=<DEPFILE>") - -set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> --compile_only --skip_assembler --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>") -set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> --preproc_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>") - -set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> --compile_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>") -set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>") -set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>") -set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>") -set(CMAKE_ASM_RESPONSE_FILE_FLAG "--cmd_file=") -set(CMAKE_C_RESPONSE_FILE_FLAG "--cmd_file=") -set(CMAKE_C_RESPONSE_FILE_LINK_FLAG " ") diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake index 7836543..c08d9a1 100644 --- a/Modules/Compiler/TI-CXX.cmake +++ b/Modules/Compiler/TI-CXX.cmake @@ -1,15 +1,2 @@ -set(CMAKE_LIBRARY_PATH_FLAG "--search_path=") -set(CMAKE_LINK_LIBRARY_FLAG "--library=") -set(CMAKE_INCLUDE_FLAG_CXX "--include_path=") - -set(CMAKE_DEPFILE_FLAGS_CXX "--preproc_with_compile --preproc_dependency=<DEPFILE>") - -set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> --compile_only --skip_assembler --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>") -set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> --preproc_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>") - -set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> --compile_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>") -set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>") -set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>") -set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>") -set(CMAKE_CXX_RESPONSE_FILE_FLAG "--cmd_file=") -set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG " ") +include(Compiler/TI) +__compiler_ti(CXX) diff --git a/Modules/Compiler/TI.cmake b/Modules/Compiler/TI.cmake new file mode 100644 index 0000000..9f2e813 --- /dev/null +++ b/Modules/Compiler/TI.cmake @@ -0,0 +1,40 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_TI) + return() +endif() +set(__COMPILER_TI 1) + +macro(__compiler_ti lang) + string(TOLOWER ${lang} prefix) + if("x${lang}" STREQUAL "xCXX") + set(prefix "cpp") + endif() + + set(CMAKE_${lang}_RESPONSE_FILE_FLAG "--cmd_file=") + + set(CMAKE_INCLUDE_FLAG_${lang} "--include_path=") + set(CMAKE_DEPFILE_FLAGS_${lang} "--preproc_with_compile --preproc_dependency=<DEPFILE>") + + set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> --preproc_only --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>") + set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> --compile_only --skip_assembler --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>") + + set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> --compile_only --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>") + + set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>") + set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>") + set(CMAKE_${lang}_ARCHIVE_FINISH "") + + # After the --run_linker flag a response file is not possible + set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "") + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 0) + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 0) + + set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>") +endmacro() + +set(CMAKE_LIBRARY_PATH_FLAG "--search_path=") +set(CMAKE_LINK_LIBRARY_FLAG "--library=") |