summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-331/+223
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | 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.
* Add options to run clang-tidy with the compilerDaniel Pfeifer2016-04-131-3/+15
| | | | | | Create a <LANG>_CLANG_TIDY target property (initialized by a CMAKE_<LANG>_CLANG_TIDY variable) to specify a clang-tidy command line to be run along with the compiler.
* Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rulesDmitry Ivanov2016-04-071-4/+24
|
* cmNinjaTargetGenerator: Factor out helper for forced response file checkDmitry Ivanov2016-04-071-0/+7
|
* Refactor `.def` file lookupTim Grothe2015-11-041-2/+3
| | | | | Return a `cmSourceFile const*` from GetModuleDefinitionFile so that callers can get more information than just the path to the file.
* Ninja: Port to cmGeneratorTarget.Stephen Kelly2015-10-241-4/+7
|
* Ninja: Refactor selection of 'deps = ' value for MS-compatible toolchainsBrad King2015-10-201-12/+4
| | | | | | Set variables in the platform information modules to tell the Ninja generator what deps type to use instead of hard-coding conditions in the generator itself.
* cmLocalGenerator: Port some API to cmGeneratorTarget.Stephen Kelly2015-10-171-1/+1
|
* Use cmGeneratorTarget for property access.Stephen Kelly2015-10-171-3/+4
|
* Use GetName from cmGeneratorTarget.Stephen Kelly2015-10-171-2/+2
|
* Merge topic 'clean-up-cmTarget'Brad King2015-10-161-15/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | 55474e61 cmState: Move GetTargetTypeName from cmTarget. 38df5c36 Remove now-obsolete casts. 4ee2b267 cmGeneratorTarget: Use enum for GetType. eac15298 cmState: Move TargetType enum from cmTarget. 482b3811 cmTarget: Move link type enum out. 2ee1cb85 cmTarget: Move ImportInfoMap out of internal class. a48bcabd cmTarget: Move backtrace member out of internal class. 6694d993 cmTarget: Remove unneeded constructors. 983c00f8 Generators: Use GetType from the cmGeneratorTarget.
| * cmState: Move GetTargetTypeName from cmTarget.Stephen Kelly2015-10-141-2/+1
| |
| * Remove now-obsolete casts.Stephen Kelly2015-10-141-1/+1
| |
| * cmState: Move TargetType enum from cmTarget.Stephen Kelly2015-10-141-15/+15
| | | | | | | | | | | | | | 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
| * Generators: Use GetType from the cmGeneratorTarget.Stephen Kelly2015-10-141-8/+9
| |
* | cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget.Stephen Kelly2015-10-141-1/+1
|/
* cmGeneratorTarget: Move GetSupportDirectory from cmTarget.Stephen Kelly2015-10-121-2/+2
|
* Merge topic 'use-generator-target'Brad King2015-10-121-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1c1c2a12 cmGeneratorTarget: Port ExpandLinkItems away from cmTarget. c66084f5 cmGeneratorTarget: Port GetImportLinkInterface away from cmTarget. 83c29e39 cmGeneratorTarget: Port ComputeLinkImplementationLibraries away from cmTarget. 19882554 cmGeneratorTarget: Port handleSystemIncludesDep away from cmTarget. c1f687b1 cmGeneratorTarget: Port GetLinkImplementationLibrariesInternal. a6e1f05c cmGeneratorTarget: Port ComputeLinkInterface away from cmTarget. 654002fe cmGeneratorTarget: Port ComputeLinkInterfaceLibraries away from cmTarget. 922c8901 cmGeneratorTarget: Port GetLinkInterface away from cmTarget. eaa5b9cb cmGeneratorTarget: Port cmTargetCollectLinkLanguages away from cmTarget. f539da12 cmGeneratorTarget: Port GetLinkInterfaceLibraries away from cmTarget. 1c5d70f9 cmGeneratorTarget: Port processILibs away from cmTarget. 064c2488 cmComputeLinkDepends: Port some API to cmGeneratorTarget. 3e428fdc cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget. 110fd2fb cmGeneratorTarget: Move GetOutputTargetType from cmTarget. e7391699 cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget. c5718217 cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget. ...
| * cmGeneratorTarget: Move GetPDBDirectory from cmTarget.Stephen Kelly2015-10-081-1/+1
| |
| * cmGeneratorTarget: Move GetDirectory from cmTarget.Stephen Kelly2015-10-081-1/+1
| |
* | cmLocalGenerator: Add current source directory accessor.Stephen Kelly2015-10-101-2/+1
| |
* | cmLocalGenerator: Add Home directory accessors.Stephen Kelly2015-10-081-1/+1
|/ | | | Reduce reasons for cmLocalGenerator to have a cmMakefile.
* Ninja: Centralize path conversion in global generator (#15757)Brad King2015-09-251-2/+2
| | | | | | | | | | | | | | | | | In the Ninja generator we run all build rules from the top of the build tree rather than changing into each subdirectory. Therefore we convert all paths relative to the HOME_OUTPUT directory. However, the Convert method on cmLocalGenerator restricts relative path conversions to avoid leaving the build tree with a "../" sequence. Therefore conversions performed for "subdirectories" that are outside the top of the build tree always use full paths while conversions performed for subdirectories that are inside the top of the build tree may use relative paths to refer to the same files. Since Ninja always runs rules from the top of the build tree we should convert them using only the top-level cmLocalGenerator in order to remain consistent. Also extend the test suite with a case that fails without this fix.
* Ninja: Refactor lookup of cmcldeps locationBrad King2015-09-181-1/+1
| | | | | This executable comes with CMake so just compute its location in cmSystemTools instead of storing it in compiler information modules.
* Add support for *.manifest source files with MSVC toolsBrad King2015-09-171-0/+9
| | | | | | | | Classify .manifest sources separately, add dependencies on them, and pass them to the MS manifest tool to merge with linker-generated manifest files. Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
* Merge topic 'ninja-LINK_DEPENDS'Brad King2015-08-061-0/+9
|\ | | | | | | | | 43c94281 Ninja: Honor the LINK_DEPENDS target property (#14796)
| * Ninja: Honor the LINK_DEPENDS target property (#14796)Brad King2015-08-051-0/+9
| |
* | cmGeneratorTarget: Move IsBundleOnApple from cmTarget.Stephen Kelly2015-08-051-1/+1
| |
* | cmGeneratorTarget: Move GetPDBName from cmTarget.Stephen Kelly2015-08-051-1/+1
| |
* | cmGeneratorTarget: Move GetCompilePDBPath from cmTarget.Stephen Kelly2015-08-051-1/+2
| |
* | cmGeneratorTarget: Move GetLinkInformation from cmTargetStephen Kelly2015-08-051-1/+1
|/
* cmCommonTargetGenerator: Store working directory for relative pathsBrad King2015-07-291-1/+1
| | | | | | | | The Makefile generators run tools with the current working directory set to the subdirectory of the build tree for the each target. The Ninja generator runs tools with the current working directory set to the top of the build tree. Tell cmCommonTargetGenerator where the working directory will be so it can compute proper relative paths.
* Merge topic 'use-generator-target'Brad King2015-07-281-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 57f03e59 Port some of the cmExportFileGenerator API to cmGeneratorTarget. 57ab0f70 Port cmExportBuildFileGenerator to cmGeneratorTarget. 570938cb cmExportTryCompileFileGenerator: Create cmGeneratorTargets. ec38e4c8 Move GetFullPath to cmGeneratorTarget dfb025bf Move GetLocationForBuild to cmGeneratorTarget. 9f2dca80 Move GetLocation to cmGeneratorTarget. c7a8e74b Always access target location from a cmGeneratorTarget instance. 5b60eaf6 cmTarget: Restore the ImportedGetLocation method. 50b17a61 cmIncludeCommand: Populate the cmGeneratorTargets in deprecated path. ba266858 cmTarget: Create cmGeneratorTargets before reading deprecated LOCATION. 5ab3a946 cmTarget: Inline GetLocation into deprecated callers. 496f4cd0 cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc. de80993a cmGlobalGenerator: Create cmGeneratorTargets earlier. 611220f7 cmTarget: Use reliable test for CMP0024 and CMP0026 OLD. bbad6ba5 cmLocalGenerator: Remove unused AddCustomCommandToCreateObject method. e4dc83ad cmLocalGenerator: Remove unused AddBuildTargetRule method. ...
| * cmCustomCommandGenerator: Require cmLocalGenerator in API.Stephen Kelly2015-07-271-1/+1
| |
* | cmNinjaTargetGenerator: Factor out compile command exporterBrad King2015-07-271-65/+87
|/
* Merge topic 'refactor-rule-var-includes'Brad King2015-07-141-0/+3
|\ | | | | | | | | | | c736de7b Factor an <INCLUDES> placeholder out of <FLAGS> in rule variables 6f94b03c Place <DEFINES> before <FLAGS> consistently across compilers
| * Factor an <INCLUDES> placeholder out of <FLAGS> in rule variablesBrad King2015-07-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | Teach the Makefile and Ninja generators to substitute for an <INCLUDES> placeholder instead of putting -I in <FLAGS>. Update our values for CMAKE_<LANG>_COMPILE_OBJECT, CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE to place <INCLUDES> just before <FLAGS>.
* | cmNinjaTargetGenerator: Restore addition of Fortran format flagsBrad King2015-07-131-0/+6
|/ | | | | | | Restore call to AppendFortranFormatFlags accidentally dropped by commit 0837538e (cmCommonTargetGenerator: Adopt GetFlags method, 2015-07-09). It was added originally by commit 6a56740e (cmNinjaTargetGenerator: Add Fortran flag generation, 2015-07-09).
* cmNinjaTargetGenerator: Use GetDefines methodBrad King2015-07-091-11/+1
| | | | | | | | | Simplify the per-source ComputeDefines implementation by getting target-wide defines from GetDefines. Technically this changes behavior by no-longer de-duplicating/sorting defines from both the target and the source, but this makes it consistent with the Makefile generator. It may also later help move target-wide defines into per-target compilation rules.
* cmCommonTargetGenerator: Adopt GetFlags methodBrad King2015-07-091-49/+1
| | | | | De-duplicate per-target flag computation in Makefile and Ninja target generators.
* cmNinjaTargetGenerator: Add OX X framework flagsBrad King2015-07-091-2/+4
| | | | | Teach ComputeFlagsForObject to add -F flags just like the Makefile generator does.
* cmNinjaTargetGenerator: Factor out AddIncludeFlags helperBrad King2015-07-091-16/+23
| | | | | Factor an AddIncludeFlags method out of ComputeFlagsForObject just like cmMakefileTargetGenerator has already.
* cmNinjaTargetGenerator: Add Fortran flag generationBrad King2015-07-091-7/+12
| | | | | Make ComputeFlagsForObject consistent with the Makefile generator in regard to Fortran flags.
* cmCommonTargetGenerator: Adopt ModuleDefinitionFile memberBrad King2015-07-091-32/+1
| | | | | De-duplicate the ModuleDefinitionFile and AddModuleDefinitionFlag members from the Makefile and Ninja target generators.
* cmCommonTargetGenerator: Adopt GetFeature and friendsBrad King2015-07-091-26/+0
| | | | | De-duplicate the GetFeature, GetFeatureAsBool, and AddFeatureFlags members from the Makefile and Ninja target generators.
* cmCommonTargetGenerator: Adopt ConfigName memberBrad King2015-07-091-5/+0
| | | | De-duplicate the member from the Makefile and Ninja target generators.
* cmCommonTargetGenerator: Adopt basic target generator membersBrad King2015-07-091-4/+1
| | | | | De-duplicate the GeneratorTarget, Target, and Makefile members from the local Makefile and Ninja generators.