1# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2# file Copyright.txt or https://cmake.org/licensing for details.
3
4
5# This module is shared by multiple languages; use include blocker.
6if(__COMPILER_TI)
7  return()
8endif()
9set(__COMPILER_TI 1)
10
11include(Compiler/CMakeCommonCompilerMacros)
12
13set(__COMPILER_TI_SOURCE_FLAG_C   "--c_file")
14set(__COMPILER_TI_SOURCE_FLAG_CXX "--cpp_file")
15set(__COMPILER_TI_SOURCE_FLAG_ASM "--asm_file")
16
17macro(__compiler_ti lang)
18  set(CMAKE_${lang}_RESPONSE_FILE_FLAG "--cmd_file=")
19  # Using --cmd_file flag is not possible after the --run_linker flag.
20  # By using a whitespace only the filename is used without flag.
21  # That file is interpreted as linker command file which may contain files to link.
22  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG " ")
23
24  set(CMAKE_INCLUDE_FLAG_${lang} "--include_path=")
25  set(CMAKE_DEPFILE_FLAGS_${lang} "--preproc_with_compile --preproc_dependency=<DEP_FILE>")
26
27  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> --preproc_only ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
28  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>")
29
30  set(CMAKE_${lang}_COMPILE_OBJECT  "<CMAKE_${lang}_COMPILER> --compile_only ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
31
32  set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
33  set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
34  set(CMAKE_${lang}_ARCHIVE_FINISH "")
35
36  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>")
37endmacro()
38
39set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
40set(CMAKE_LINK_LIBRARY_FLAG "--library=")
41