summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-9/+12
|
* Ninja: Fix POST_BUILD noop on WindowsBrad King2016-10-281-1/+1
| | | | | | Use `cd .` instead of `:` in a Windows shell. Closes: #16393
* Merge topic 'ninja-only-object-rules'Brad King2016-10-201-3/+4
|\ | | | | | | | | 3a9e92bc Ninja: Add compile rules only for languages that are actually compiled
| * Ninja: Add compile rules only for languages that are actually compiledBrad King2016-10-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | In `WriteLanguageRules` we collect all languages used for source files in a target. However, this only needs to include sources that are actually going to be compiled into object files. No object file build statements will be generated for other sources. This avoids generating language compile rules for source files that are not compiled due to being marked as `HEADER_FILE_ONLY`. Issue: #16373
* | cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | | | | | | Include it in dependents which have previously relied on it transitively.
* | cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
| |
* | cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-22/+22
|/
* cmRulePlaceholderExpander: Port clients to direct-useStephen Kelly2016-10-151-3/+7
| | | | | | Add a factory function to cmLocalGenerator so that variableMappings can be provided from it, and so that Ninja can always have a hard-coded TargetImpLib.
* cmLocalGenerator: Use strings instead of a Target in rule replacementStephen Kelly2016-10-151-1/+4
| | | | Don't rely on the cmGeneratorTarget type needlessly.
* cmLocalGenerator: Use a converter in rule replacement APIStephen Kelly2016-10-151-1/+2
| | | | | | | The rule replacement API should not really be in cmLocalGenerator, but it was historically, and this coupled many other things together here too, such as output conversion. Make the output converter a parameter so that rule replacement can be removed from cmLocalGenerator.
* cmLocalGenerator: Remove the launcher from RuleVariablesStephen Kelly2016-10-151-1/+9
| | | | | | | | | This one is not like the others as it doesn't participate in substitutions. Keep ExpandRuleVariables doing only one thing and make callers responsible for inserting a launcher prefix, simplifying the code all-around. Remove now-obsolete InsertRuleLauncher method.
* Merge topic 'ninja-framework-POST_BUILD'Brad King2016-10-141-2/+4
|\ | | | | | | | | 20278872 Ninja: Fix POST_BUILD commands on macOS Frameworks
| * Ninja: Fix POST_BUILD commands on macOS FrameworksBrad King2016-10-131-2/+4
| | | | | | | | | | | | | | | | | | | | The condition added by commit v2.8.12~179^2 (OS X: Fix regression handling frameworks for Ninja, 2013-07-16) for excluding use of versioning symlinks on macOS Frameworks must match that used for POST_BUILD selection. Otherwise we place the POST_BUILD commands after a symlink step that is never added. Closes: #16363
* | Honor LINK_WHAT_YOU_USE when set to OFFJamie Snape2016-10-131-2/+2
| | | | | | | | | | | | Explicitly setting variable CMAKE_LINK_WHAT_YOU_USE or property LINK_WHAT_YOU_USE to OFF should not cause LWYU to run. Fix the property lookup to use GetPropertyAsBool.
* | cmLinkLineComputer: Move FrameworkPath computation from cmLocalGeneratorStephen Kelly2016-10-101-4/+4
| | | | | | | | Add UseWatcomQuote state, and remove corresponding method parameters.
* | cmLinkLineComputer: Move ComputeLinkLibs from cmLocalGeneratorStephen Kelly2016-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a cmOutputConverter to the cmLinkLineComputer and factory methods to facilitate shell escapes. Add state to the cmLinkLineComputer to record whether outputting for response files or for watcom, to satisfy the cmOutputConverter API. These are constant for the lifetime of the cmLinkLineComputer, even when its functionality is extended in the future. This also keeps the signatures of cmLinkLineComputer relatively simple. Pass the cmComputeLinkInformation as a method parameter so that cmLinkLineComputer is free from target-specific state. An instance should be usable for all targets in a directory.
* | cmLinkLineComputer: Extract from cmLocalGeneratorStephen Kelly2016-10-101-4/+10
|/ | | | | | | | | | | CMake has several classes which have too many responsibilities. cmLocalGenerator is one of them. Start to extract the link line computation. Create generator-specific implementations of the interface to account for generator-specific behavior. Unfortunately MSVC60 has different behavior to everything else and CMake still generates makefiles for it. Isolate it with MSVC60-specific names.
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* cmGlobalNinjaGenerator: Teach WriteBuild about implicit outputsBrad King2016-09-201-3/+6
| | | | | | | | Ninja 1.7 introduced support for implicit outputs on build statements. Teach WriteBuild to generate the corresponding syntax. Leave it up to callers to decide whether implicit outputs are supported by the Ninja version in use. For now simply update all call sites to pass an empty list of implicit outputs.
* Ninja: Update comment variable referenceStephen Kelly2016-09-191-1/+2
|
* cmNinjaNormalTargetGenerator: make sure comments match parameter namesDaniel Pfeifer2016-09-161-2/+2
|
* Convert: Replace uses of Convert(NONE)Stephen Kelly2016-08-271-2/+2
| | | | These are equivalent to ConvertToOutputFormat.
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-0/+12
|
* Merge topic 'ninja-no-accidental-rsp'Brad King2016-07-181-1/+1
|\ | | | | | | | | 86dd2427 Ninja: Do not force response files when no sysconf(3) limit is used
| * Ninja: Do not force response files when no sysconf(3) limit is usedBrad King2016-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | Commit v3.6.0-rc1~174^2~1 (cmGlobalNinjaGenerator: Clarify logic for forcing use of response files, 2016-04-06) started using negative command line length values to represent forced use of response files but forgot to update `calculateCommandLineLengthLimit()` accordingly. Teach it to return `0` instead of `-1` when no limit is computed from the system to avoid forcing response files. Reported-by: Raphael Kubo da Costa <rakuco@FreeBSD.org>
* | Ninja: Generalize check for sysconf(3) callRaphael Kubo da Costa2016-07-151-1/+1
| | | | | | | | | | | | | | Use `sysconf(_SC_ARG_MAX)` wherever `_SC_ARG_MAX` is available instead of hard-coding an incomplete list of operating systems that implement it. In particular, it is available on BSD platforms that were not previously listed.
* | Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exportsYury Zhuravlev2016-07-111-2/+4
| | | | | | | | | | For executables with ENABLE_EXPORTS set, export all symbols when instructed to do so by WINDOWS_EXPORT_ALL_SYMBOLS.
* | use CM_NULLPTRDaniel Pfeifer2016-06-281-1/+1
| |
* | Merge topic 'link_what_you_use'Brad King2016-06-171-2/+22
|\ \ | | | | | | | | | | | | | | | a0902efa Help: Add notes for topic 'link_what_you_use' 96242f80 Add options to run `ldd -u -r` as a "link-what-you-use" tool
| * | Add options to run `ldd -u -r` as a "link-what-you-use" toolBill Hoffman2016-06-171-2/+22
| |/ | | | | | | | | | | | | Create a LINK_WHAT_YOU_USE target property and corresponding CMAKE_LINK_WHAT_YOU_USE variable to enable this behavior. Extend link commands by running `ldd -u -r` to detect shared libraries that are linked but not needed.
* | Add missing braces around statements.Daniel Pfeifer2016-06-101-6/+9
| | | | | | | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.
* | Merge topic 'ninja-no-ranlib-windows'Brad King2016-06-091-0/+15
|\ \ | | | | | | | | | | | | ea598671 Run ranlib on archives only if the tool is available
| * | Run ranlib on archives only if the tool is availableBrad King2016-06-081-0/+15
| |/ | | | | | | | | | | | | | | | | | | | | | | | | CMakeFindBinUtils sets CMAKE_RANLIB to `:` if it is not available in order to get a no-op. This does not work on a Windows host build environment that runs commands in `cmd` instead of `sh`. Teach the Ninja and Makefile generators to simply skip the command if it is `:`. This this was already done by the Makefile generator since commit v2.6.0~3161 (BUG: Do not write link script lines that use the ':', 2006-06-18), but only when using a link script. Reported-by: Michael Jäntsch <Michael.Jaentsch@gmx.de>
* | cmLocalGenerator: Pass configuration to GetTargetFlagsTobias Hunger2016-06-081-3/+3
|/ | | | | Move the configuration lookup to call sites. This will allow multi-configuration callers to use the method.
* Remove redundant c_str() calls.Daniel Pfeifer2016-05-261-3/+3
| | | | | Run clang-tidy's readability-redundant-string-cstr checker. Ignore findings in kwsys.
* Use enums defined in cmOutputConverter using their fully qualified name.Daniel Pfeifer2016-05-251-11/+11
| | | | | | | | | Mostly automated: values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT" "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE" "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree") for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
* Ninja: Fix path to soname-d target fileNicolas Despres2016-05-171-1/+2
| | | | | In WriteLinkStatement we convert all target output paths to ninja-style paths. Add a missing conversion for the `soname` file name.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-352/+239
| | | | | | | | | | | | | 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.
* cmGlobalNinjaGenerator: Clarify logic for forcing use of response filesDmitry Ivanov2016-04-071-1/+1
| | | | | Update the WriteBuild method to use a negative command line length limit to specify that we should force use of response files.
* cmNinjaTargetGenerator: Factor out helper for forced response file checkDmitry Ivanov2016-04-071-3/+1
|
* Ninja: Add OS X dylib versioning (#14140)Bruce Stephens2016-03-071-0/+10
| | | | | | | | Teach the Ninja generator to add the `-current_version` and the `-compatibility_version` flags based on the VERSION and SOVERSION target properties just as the Makefile generators do. Signed-off-by: Bruce Stephens <bruce.r.stephens@gmail.com>
* cmGeneratorTarget: Add API for target-relative commands.Stephen Kelly2015-10-261-3/+3
|
* Ninja: Port to cmGeneratorTarget.Stephen Kelly2015-10-241-18/+18
|
* cmGeneratorTarget: Move IsCFBundleOnApple from cmTarget.Stephen Kelly2015-10-191-2/+2
|
* cmGeneratorTarget: Copy IsAppBundleOnApple from cmTarget.Stephen Kelly2015-10-191-1/+1
| | | | Leave the cmTarget method behind for now to implement cmInstallCommand.
* cmGeneratorTarget: Copy IsFrameworkOnApple from cmTarget.Stephen Kelly2015-10-191-3/+3
| | | | Leave the cmTarget method behind for now to implement cmInstallCommand.
* cmLocalGenerator: Port some API to cmGeneratorTarget.Stephen Kelly2015-10-171-1/+1
|