summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-6/+6
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* Ninja: Pass preprocessor definitions when compiling with Intel FortranBrad King2019-09-031-0/+1
| | | | | | | | The Intel Fortran compiler supports an extension that allows conditional compilation based on preprocessor definitions specified on the command line even when not preprocessing. Fixes: #19664
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Ninja: add support for Swift's output-file-map.jsonSaleem Abdulrasool2019-05-161-0/+7
| | | | | | | Add an emitter for the Swift's output-map-file.json to emit the requisite support files for Swift compilation. This additionally prevents the build rules for the object file emission as well to properly support the Swift build semantics.
* Ninja: Add support for ADDITIONAL_CLEAN_FILES target propertySebastian Holtermann2019-05-141-0/+2
|
* Ninja: In cmNinjaTargetGenerator use std::unique_ptr to manage new instancesSebastian Holtermann2019-05-131-1/+3
|
* Ninja,Makefile: use `unique_ptr` for memory managementSaleem Abdulrasool2019-04-181-2/+2
| | | | | Use a `unique_ptr` to manage the lifetime of the `MacOSXContentGenerator` and 'OSXBundleGenerator` rather than manually handling the lifetime.
* ninja: do not assume explicit preprocessing uses that outputBen Boeckel2019-02-251-0/+1
| | | | | | In Fortran, this is OK, but for C++, compiling preprocessed source generally results in poorer diagnostic messages and can also be ill-formed anyways.
* ninja: make dyndep generation language awareBen Boeckel2019-02-251-1/+2
| | | | | A target may have multiple languages with dyndep rules, separate `.dd` files should be generated.
* Replace occurrences of "Mac OS X" with "macOS" in commentsBartosz Kosiorek2018-09-101-1/+1
| | | | | | | | Apple's main Operating system changed their name from OS X to macOS: https://www.engadget.com/2016/06/13/os-x-is-now-macos/ Revise source comments accordingly.
* LINK_DEPENDS: add support for property INTERFACE_LINK_DEPENDSMarc Chevrier2018-06-271-1/+1
| | | | Fixes: #17997
* sourceFile properties: add property INCLUDE_DIRECTORIESMarc Chevrier2018-01-241-0/+3
|
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-5/+3
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* ninja: break unnecessary target dependenciesBen Boeckel2017-04-211-2/+1
| | | | | | | | | | | | | | | | | | Previously, given two libraries, X and Y where X depends on Y, all object compilations of X would require the Y library to have been linked before being compiled. This is not necessary and can instead be loosened such that object compilations of X only depend on the order-only dependencies of Y to be completed. This is to ensure that generated sources, headers, custom commands, etc. are completed before X starts to compile its objects. This should help build performance in projects with many libraries which cause a deep library dependency chain. Previously, a library at the bottom would not start compilation until after all other libraries completed, but now only its link step needs to wait and its compilation jobs can be run in parallel with other tasks. Fixes: #15555
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* 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.
* Ninja: Add dyndep rules for Fortran module dependenciesBrad King2016-09-221-0/+10
| | | | | Teach the Ninja generator to add dyndep rules and bindings as described in the design comment in `Source/cmGlobalNinjaGenerator.cxx`.
* Ninja: Add explicit preprocessing step for FortranBrad King2016-09-221-0/+5
| | | | | | | | | | All Fortran sources need to be preprocessed before any source may be compiled so that module dependencies can be (later) extracted. Factor out an explicit preprocessing step preceding compilation. Use Ninja depfile dependencies on the preprocessing step and then compile the already-preprocessed source with a separate build statement that depends explicitly only on the preprocessor output. Later we will insert dynamic discovery of module dependencies between these steps.
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-4/+8
|
* mark functions with CM_OVERRIDEDaniel Pfeifer2016-06-271-3/+5
|
* Ninja: Make bundle resources a dependency of their targetFlorent Castelli2016-06-231-0/+1
| | | | Fixes #13816.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-27/+25
| | | | | | | | | | | | | 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.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+0
| | | | | 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.
* cmNinjaTargetGenerator: Factor out helper for forced response file checkDmitry Ivanov2016-04-071-0/+2
|
* Ninja: Port to cmGeneratorTarget.Stephen Kelly2015-10-241-4/+1
|
* Ninja: Centralize path conversion in global generator (#15757)Brad King2015-09-251-4/+4
| | | | | | | | | | | | | | | | | 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.
* cmNinjaTargetGenerator: Factor out compile command exporterBrad King2015-07-271-0/+11
|
* cmCommonTargetGenerator: Adopt GetFlags methodBrad King2015-07-091-3/+0
| | | | | De-duplicate per-target flag computation in Makefile and Ninja target generators.
* cmNinjaTargetGenerator: Factor out AddIncludeFlags helperBrad King2015-07-091-0/+2
| | | | | Factor an AddIncludeFlags method out of ComputeFlagsForObject just like cmMakefileTargetGenerator has already.
* cmCommonTargetGenerator: Adopt ModuleDefinitionFile memberBrad King2015-07-091-6/+0
| | | | | De-duplicate the ModuleDefinitionFile and AddModuleDefinitionFlag members from the Makefile and Ninja target generators.
* cmCommonTargetGenerator: Adopt GetFeature and friendsBrad King2015-07-091-4/+0
| | | | | De-duplicate the GetFeature, GetFeatureAsBool, and AddFeatureFlags members from the Makefile and Ninja target generators.
* cmCommonTargetGenerator: Adopt ConfigName memberBrad King2015-07-091-2/+0
| | | | De-duplicate the member from the Makefile and Ninja target generators.
* cmCommonTargetGenerator: Adopt basic target generator membersBrad King2015-07-091-3/+0
| | | | | De-duplicate the GeneratorTarget, Target, and Makefile members from the local Makefile and Ninja generators.
* Add common base classes to Makefile and Ninja generatorsBrad King2015-07-091-1/+3
| | | | Provide a place to move functionality common to both.
* cmNinjaGenerator: Require cmGeneratorTarget.Stephen Kelly2015-06-221-1/+1
|
* Ninja: Generate separate compile and link rules for each targetBrad King2015-05-181-2/+1
| | | | | | | | Our <LANG>_COMPILER and <LANG>_<TARGET_TYPE>_LINKER rule generation has access to a specific cmTarget so the results may depend on it. Instead generate separate rules for each target using an encoded target name. In particular, this makes CTEST_USE_LAUNCHERS report proper target information.
* Ninja: Use "deps = msvc" only for C and CXX (#15253)Brad King2015-01-291-1/+1
| | | | | | | | The "/showIncludes" flag is only available with MS C and C++ compilers, and on compilers that "simulate" them (like Intel for Windows). Fix our logic to choose this type only for MS tools with these languages. All other cases need to use "deps = gcc" and define DEP_FILE in the build rule.
* Ninja: Remove unused declarationPeter Collingbourne2014-11-141-1/+0
|
* Ninja: Skip generating empty phony rulesAdam Strzelecki2014-06-301-1/+2
| | | | | | | | | Ninja generator ensures that all custom commands being target dependencies are run before other source compilations. However in case there are no such dependencies it currently generates empty phony rules which clutter the build graph. Teach the Ninja generator to produce such rules only when necessary.
* ninja: Factor out target-level order-only dependenciesBen Boeckel2014-05-071-0/+4
| | | | | | This reduces ninja file output even more for projects with lots of libraries with entangled transitive dependencies. ParaView goes from the previous 58M to about 45M.
* ninja: Use string parametersBen Boeckel2014-05-021-2/+2
|
* Ninja: Query custom commands once per target, not once per file.Stephen Kelly2014-04-051-0/+1
| | | | | Computing the source files is now more expensive, so the Ninja generator became very slow with a large number of files.
* Constify some APIs in generators.Stephen Kelly2014-03-131-5/+5
|
* cmOSXBundleGenerator: Make MacOSXContentGeneratorType arg const.Stephen Kelly2014-03-131-1/+1
|
* stringapi: Use strings for feature argumentsBen Boeckel2014-03-081-2/+2
|
* stringapi: Return a string reference for the configurationBen Boeckel2014-03-081-1/+1
|
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-1/+1
| | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* stringapi: Use strings for the languagesBen Boeckel2014-03-081-1/+1
|