mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 14:20:06 -06:00
Compiler/TI: Avoid generic variable name in macro
In commit a548a52230 (Compiler/TI: Refactor C/CXX to use a common file,
2020-07-11) a variable named `prefix` has been introduced.
It is set in the callers namespace because it was defined inside a
macro, not a function.
Avoid such generic variable name.
This commit is contained in:
@@ -8,21 +8,20 @@ if(__COMPILER_TI)
|
||||
endif()
|
||||
set(__COMPILER_TI 1)
|
||||
|
||||
macro(__compiler_ti lang)
|
||||
string(TOLOWER ${lang} prefix)
|
||||
if("x${lang}" STREQUAL "xCXX")
|
||||
set(prefix "cpp")
|
||||
endif()
|
||||
set(__COMPILER_TI_SOURCE_FLAG_C "--c_file")
|
||||
set(__COMPILER_TI_SOURCE_FLAG_CXX "--cpp_file")
|
||||
set(__COMPILER_TI_SOURCE_FLAG_ASM "--asm_file")
|
||||
|
||||
macro(__compiler_ti lang)
|
||||
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}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> --preproc_only ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
|
||||
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> --compile_only --skip_assembler ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<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}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> --compile_only ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<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>")
|
||||
|
||||
Reference in New Issue
Block a user