[cmake-developers] [CMake 0014879]: Use short switches for TI toolchain

Mantis Bug Tracker mantis at public.kitware.com
Tue Apr 15 10:31:24 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14879 
====================================================================== 
Reported By:                raspy
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14879
Category:                   CMake
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-04-15 10:31 EDT
Last Modified:              2014-04-15 10:31 EDT
====================================================================== 
Summary:                    Use short switches for TI toolchain
Description: 
Currently TI support uses long options when compiling, but most of these options
have shorter versions. Longer versions can be problematic, since command line
length is limited (especially short on Windows) and, for example, having
multiple include directories prepended with '--include_path=' versus '-I' may
decide whether the build compiles or not.

I suggest to change at least the following (all suggestions using TI-C.cmake,
but suggestions are also appropriate for TI-CXX.cmake and TI-ASM.cmake):

Replace:
set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
set(CMAKE_LINK_LIBRARY_FLAG "--library=")
set(CMAKE_INCLUDE_FLAG_C "--include_path=")

With:
set(CMAKE_LIBRARY_PATH_FLAG "-I")
set(CMAKE_LINK_LIBRARY_FLAG "-l")
set(CMAKE_INCLUDE_FLAG_C "-I")

It would also be good to change other rules as well:

Replace:
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> --compile_only
--skip_assembler --c_file=<SOURCE> <DEFINES> <FLAGS>
--output_file=<ASSEMBLY_SOURCE>")
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> --preproc_only
--c_file=<SOURCE> <DEFINES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")

set(CMAKE_C_COMPILE_OBJECT  "<CMAKE_C_COMPILER> --compile_only --c_file=<SOURCE>
<DEFINES> <FLAGS> --output_file=<OBJECT>")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -r <TARGET> <OBJECTS>")
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker
--output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_C_LINK_FLAGS>
<LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>")

With:
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> -c -n -fc <SOURCE>
<DEFINES> <FLAGS> -fe <ASSEMBLY_SOURCE>")
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> -ppo -fc <SOURCE>
<DEFINES> <FLAGS> -fe <PREPROCESSED_SOURCE>")

set(CMAKE_C_COMPILE_OBJECT  "<CMAKE_C_COMPILER> -c -fc <SOURCE> <DEFINES>
<FLAGS> -fe <OBJECT>")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> r <TARGET> <OBJECTS>")
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> -z -o <TARGET> -m <TARGET>.map
<CMAKE_C_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>")

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-04-15 10:31 raspy          New Issue                                    
======================================================================



More information about the cmake-developers mailing list