Commit Graph

29 Commits

Author SHA1 Message Date
Brad King a896043bac GHS: Compute include directories consistently with other generators
All generators use cmLocalGenerator::GetIncludeDirectories to construct
the final list of include directories for a target.
2016-05-24 11:40:35 -04:00
Geoff Viola d7233a0472 GHS: Use shorter object file names on collision 2016-05-18 09:27:19 -04:00
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Geoff Viola 5e4287131b GHS: Shorten long object paths with duplicate source names
Detect when the resulting object path is too long and compute an
alternative name using a hash.
2016-05-06 08:21:05 -04:00
Brad King e1c7747253 Format include directive blocks and ordering with clang-format
Sort include directives within each block (separated by a blank line) in
lexicographic order (except to prioritize `sys/types.h` first).  First
run `clang-format` with the config file:

    ---
    SortIncludes: false
    ...

Commit the result temporarily.  Then run `clang-format` again with:

    ---
    SortIncludes: true
    IncludeCategories:
      - Regex:    'sys/types.h'
        Priority: -1
    ...

Commit the result temporarily.  Start a new branch and cherry-pick the
second commit.  Manually resolve conflicts to preserve indentation of
re-ordered includes.  This cleans up the include ordering without
changing any other style.

Use the following command to run `clang-format`:

    $ git ls-files -z -- \
        '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
      egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
      egrep -z -v '^Source/cm_sha2' |
      egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
      egrep -z -v '^Utilities/(KW|cm).*/' |
      egrep -z -v '^Tests/Module/GenerateExportHeader' |
      egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
      xargs -0 clang-format -i

This selects source files that do not come from a third-party.

Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
2016-04-29 13:58:54 -04:00
Brad King 180538c706 Source: Stabilize include order
Each source file has a logical first include file.  Include it in an
isolated block so that tools that sort includes do not move them.
2016-04-29 13:58:31 -04:00
Geoff Viola 1703a6d2c4 GHS: Fix handling of duplicate source filenames (#16046)
Green Hills MULTI project files must specify explicitly distinct object
file names for source files with the same name.
2016-04-25 10:46:09 -04:00
Geoff Viola 36ad8dd440 GHS: Implement link flags and dirs for non-target groups (#16029) 2016-03-28 11:46:46 -04:00
Geoff Viola bf3e76d214 GHS: Fix try_compile (#15975) 2016-03-21 10:35:01 -04:00
Stephen Kelly 3f8aa62bfb cmGeneratorTarget: Add API for target-relative commands. 2015-10-26 22:02:13 +01:00
Stephen Kelly b74aa0e3d2 GHS: Port to cmGeneratorTarget. 2015-10-24 09:19:55 +02:00
Stephen Kelly 311018e5ad cmGeneratorTarget: Move GetExportMacro from cmTarget. 2015-10-21 00:52:22 +02:00
Stephen Kelly 3e8ef64273 cmLocalGenerator: Port some API to cmGeneratorTarget. 2015-10-17 17:30:38 +02:00
Brad King 893ce307f9 Merge topic 'ghs-drop-optgroup'
ce7ccafc GHS: Remove extra flag to GHS MULTI compiler (#15771)
2015-10-16 09:35:41 -04:00
Geoff Viola ce7ccafce2 GHS: Remove extra flag to GHS MULTI compiler (#15771)
Do not produce "{optgroup=GhsCommonOptions}" in the generated .gpj
files.  The flag was added originally to match an old project file, but
it does not seem necessary and is not compatible with all GHS versions.
2015-10-15 09:56:47 -04:00
Stephen Kelly eac15298a8 cmState: Move TargetType enum from cmTarget.
Mostly automated:

 values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType")
 for i in "${values[@]}"; do     git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
2015-10-15 00:41:39 +02:00
Stephen Kelly 983c00f8f9 Generators: Use GetType from the cmGeneratorTarget. 2015-10-15 00:41:19 +02:00
Stephen Kelly 12cb3bdce4 cmLocalGenerator: Add Home directory accessors.
Reduce reasons for cmLocalGenerator to have a cmMakefile.
2015-10-09 00:00:19 +02:00
Stephen Kelly 5d3776a7eb Access sources through cmGeneratorTarget. 2015-10-07 08:37:56 +02:00
Stephen Kelly 7ce0991a7a GHS: Port API to cmGeneratorTarget. 2015-10-07 08:37:56 +02:00
Geoff Viola 04de900704 GHS: Fix generated file path slashes and quoting for 6.1.6 2015-09-09 10:15:37 -04:00
Geoff Viola fbe0de92f0 GHS: Tell MULTI to delete .elf.ael file 2015-09-09 10:14:54 -04:00
Stephen Kelly a7f5d70dde cmGeneratorTarget: Move compile defintions processing from cmTarget. 2015-08-26 19:46:30 +02:00
Stephen Kelly db4cb92bda cmGeneratorTarget: Move compile options processing from cmTarget. 2015-08-26 19:45:51 +02:00
Stephen Kelly e6ccbf6f30 cmGeneratorTarget: Move include directory processing from cmTarget. 2015-08-26 19:45:21 +02:00
Stephen Kelly 7c809fa2a6 cmGeneratorTarget: Move GetLinkerLanguage from cmTarget. 2015-08-05 18:20:48 +02:00
Stephen Kelly faec4e611d cmComputeTargetDepends: Change API to use cmGeneratorTarget. 2015-07-01 19:46:19 +02:00
Stephen Kelly dee197fe61 GHS: Use a cmGeneratorTarget in generator API. 2015-06-22 13:23:45 -04:00
Geoff Viola 48004d9dbe Add a 'Green Hills MULTI' generator on Windows
Green Hills MULTI is an IDE for embedded real-time systems.  The IDE's
product page can be found here:

 http://www.ghs.com/products/MULTI_IDE.html

It supports cross compiling on ARM, Intel x86, and other architectures
with various operating systems.  The IDE exists on Linux and Windows
host systems, but CMake will currently only generate the project files
on Windows host systems.
2015-04-20 13:55:40 -04:00