summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmTarget: use static strings for special property namesBen Boeckel2018-01-311-14/+28
| | | | | Similar to 660769151a7f628f92eb28d77bcae854eaae54c2, the `SetProperty` side is showing up in performance listings due to string comparisons.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-5/+7
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Autogen: Process files concurrently in AUTOMOC and AUTOUICSebastian Holtermann2018-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | This introduces concurrent thread processing in the `_autogen` target wich processes AUTOMOC and AUTOUIC. Source file parsing is distributed among the threads by using a job queue from which the threads pull new parse jobs. Each thread might start an independent ``moc`` or ``uic`` process. Altogether this roughly speeds up the AUTOMOC and AUTOUIC build process by the number of physical CPUs on the host system. The exact number of threads to start in the `_autogen` target is controlled by the new AUTOGEN_PARALLEL target property which is initialized by the new CMAKE_AUTOGEN_PARALLEL variable. If AUTOGEN_PARALLEL is empty or unset (which is the default) the thread count is set to the number of physical CPUs on the host system. The AUTOMOC/AUTOUIC generator and the AUTORCC generator are refactored to use a libuv loop internally. Closes #17422.
* cmSourceFile: mark known locations as suchBen Boeckel2018-01-101-2/+4
| | | | | | | | | | Primarily, this includes: - the rule files generated for custom targets; - source files representing custom targets directly; - outputs of custom commands; - byproducts of custom commands; and - dependencies of custom commands.
* cmSourceFileLocation: allow skipping ambiguous extensionsBen Boeckel2018-01-101-0/+1
| | | | | | | | | | | The ambiguous extension logic is an old behavior that ends up taking lots of extra compute cycles to execute. This is triggered by various CMake codepaths which pass extension-less paths down when CMake actually knows that they are not ambiguous. These codepaths will be indicated in upcoming changes. Various APIs have gained a cmSourceFileLocationKind parameter, but they are all optional and default to the existing behavior.
* Merge topic 'fortran-compiler-launcher'Brad King2017-11-291-0/+1
|\ | | | | | | | | | | | | f19c70c3 Fortran: Add option to run the compiler through launcher tools Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1517
| * Fortran: Add option to run the compiler through launcher toolsBrad King2017-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | Add a `Fortran_COMPILER_LAUNCHER` target property like those added for C and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler through tools like ccache or distcc, 2015-06-04) and CUDA by commit v3.10.0-rc1~531^2 (CUDA: Add option to run the compiler through launcher tools, 2017-06-09). Fixes: #17499
* | server: return whether or not a target is generator providedJustin Goshi2017-11-201-0/+1
|/ | | | | | Some generators auto-generate targets. For example VS generators create the ALL_BUILD target. Add the ability to mark targets as generator provided and return that info through cmake-server codemodel.
* CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variableBrad King2017-11-171-0/+1
| | | | | | | Use its value to initialize the `CUDA_SEPARABLE_COMPILATION` target property when targets are created. Fixes: #17478
* Add new target-property `IMPORTED_GLOBAL`.Deniz Bahadir2017-11-071-0/+53
| | | | | | | | | | | | | | | The purpose of this new `IMPORTED_GLOBAL` target-property is to prolong the lifetime and scope of `IMPORTED` targets in such a way as if they had been created with the keyword `GLOBAL` in the first place. * It can only be set to `TRUE`. That means, a local `IMPORTED` target can be promoted to global scope but a global `IMPORTED` target cannot be degraded to local scope! * Setting it to `TRUE` only succeeds if done from within the same directory in which the `IMPORTED` target was created in the first place. Fixes #17256.
* cmTarget: Simplified and fixed a string-comparision.Deniz Bahadir2017-11-031-1/+1
| | | | | | | | Before this change, `cmTarget::CheckProperty` accepted several strings as valid properties, including all strings prefixed with "INTERFACE_LINK_LIBRARIES". Now, that particular string is still accepted but other strings prefixed with that string are no longer accepted.
* Do not initialize NO_SYSTEM_FROM_IMPORTED on INTERFACE librariesBrad King2017-10-131-4/+1
| | | | | | | | | | | | | | The change in commit v3.8.0-rc1~276^2 (Allow NO_SYSTEM_FROM_IMPORTED on imported INTERFACE libraries, 2016-11-21) was incorrect. The property is not meant to be set on imported targets at all. It is meant to be set on their consumers that compile sources. Since INTERFACE libraries have no sources to compile, the property is not needed on them. Revert most of that change. Unfortunately we must still tolerate project code setting NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries because they were allowed by CMake 3.8 and 3.9. Issue: #17348
* Autogen: Add (CMAKE_)AUTOMOC_COMPILER_PREDEFINESSebastian Holtermann2017-09-291-0/+1
|
* Performance: Improve efficiency of source file lookup in cmMakefileAaron Orenstein2017-09-201-0/+1
| | | | Add an unordered map to cmMakefile to speed up GetSource() lookups.
* cmSourceFileLocation: Drop unnecessary copy-assignment operatorAaron Orenstein2017-09-201-2/+3
| | | | Update the one place that used it to avoid needing assignment.
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-2/+2
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-26/+17
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* Add properties to run cppcheck along with the compilerBill Hoffman2017-08-301-0/+2
| | | | | | Create a `<LANG>_CPPCHECK` target property (initialized by a `CMAKE_<LANG>_CPPCHECK` variable) to specify a `cppcheck` command line to be run along with the compiler.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-92/+92
|
* Use C++11 unordered containersDaniel Pfeifer2017-08-221-2/+2
|
* Autogen: Add AUTOMOC_MACRO_NAMES supportSebastian Holtermann2017-08-181-0/+1
| | | | Closes #17176
* CUDA: Add option to run the compiler through launcher toolsBrad King2017-06-091-0/+1
| | | | | | | | Add a `CUDA_COMPILER_LAUNCHER` target property like those added for C and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler through tools like ccache or distcc, 2015-06-04). Fixes: #16953
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+1
|
* Merge topic 'enable_ptx_compilation'Brad King2017-04-211-0/+8
|\ | | | | | | | | | | | | 23691d78 CUDA: Allow sources to be compiled to .ptx files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !725
| * CUDA: Allow sources to be compiled to .ptx filesRobert Maynard2017-04-201-0/+8
| | | | | | | | | | When the target property `CUDA_PTX_COMPILATION` is enabled CUDA OBJECT libraries will generate ptx files instead of object files.
* | Replace boolean `implib` parameters with enumGregor Jasny2017-04-201-53/+89
|/ | | | | Named enumeration values are much clearer at call sites and add more type safety.
* Merge topic 'objlib-extend'Brad King2017-04-191-11/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | eec93bce Allow OBJECT libraries to be installed, exported, and imported 93c89bc7 Genex: Allow TARGET_OBJECTS to be used everywhere ac0cf7ff Genex: Reject TARGET_OBJECTS on non-object libraries earlier 8577978c Tests: ExportImport C code should use explicit (void) in prototypes 26cfd039 cmInstallTargetGenerator: Re-order GenerateScriptForConfig logic 25f3f22a cmGlobalGenerator: Add method to check if object file location is known d596c550 cmGeneratorTarget: Add method to get the object file directory 930042f2 cmGeneratorTarget: Factor out a GetTargetObjectNames method ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !712
| * Allow OBJECT libraries to be installed, exported, and importedRobert Maynard2017-04-181-11/+19
| | | | | | | | | | | | | | | | Teach install() and export() to handle the actual object files. Disallow this on Xcode with multiple architectures because it still cannot be cleanly supported there. Co-Author: Brad King <brad.king@kitware.com>
* | Support CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>Ruslan Baratov2017-04-171-7/+4
|/
* 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'
* Add variable 'CMAKE_INTERPROCEDURAL_OPTIMIZATION'Ruslan Baratov2017-03-021-0/+1
|
* Autogen: Add AUTOUIC_SEARCH_PATHS supportSebastian Holtermann2017-03-021-0/+1
| | | | Closes #15227
* Autogen: Add AUTOMOC_DEPEND_FILTERS supportSebastian Holtermann2017-02-221-0/+1
|
* Apple: Add BUILD_WITH_INSTALL_NAME_DIR target propertyClinton Stimpson2017-02-141-0/+1
| | | | | This new property controls whether to apply INSTALL_NAME_DIR to the build tree. It also overrides BUILD_WITH_INSTALL_RPATH.
* Apple: Add support for static frameworksGregor Jasny2017-01-311-1/+2
| | | | Closes: #16432
* Add properties to run the cpplint style checker with the compilerJamie Snape2017-01-231-0/+2
| | | | | | Create a `<LANG>_CPPLINT` target property (initialized by a `CMAKE_<LANG>_CPPLINT` variable) to specify a `cpplint` style checker command line to be run along with the compiler.
* Add a getter for manually added target dependenciesGregor Jasny2017-01-161-0/+17
| | | | Closes: #16165
* cmTarget: Enforce TYPE being a read-only propertyGregor Jasny2017-01-091-0/+6
|
* Merge topic 'initial_cuda_language_support'Brad King2016-11-291-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4cc601f2 Help: Add release note for CUDA support 7b9131da CUDA: Add tests to verify CUDA compiler works properly. 9cf5b98d CUDA: Prefer environment variables CUDACXX and CUDAHOSTCXX. a5e806b3 CUDA: Add support for CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY d038559e CUDA: Add separable compilation support to the makefile generator. 43ce4414 CUDA: Add separable compilation support to the ninja generator. 4b316097 CUDA: Add support for the CUDA_SEPARABLE_COMPILATION target property ae05fcc6 CUDA: Add LinkLineComputer that computes cuda dlink lines. 115269a8 CUDA: Refactor cmLinkLineComputer to allow for better derived children. 5dec4031 CUDA: Refactor CMakeCUDAInformation to prepare for separable compilation. 5b20d0ab CUDA: C++ compile features now enable cuda c++11 support. 489c52ce CUDA: Use the host compiler for linking CUDA executables and shared libs. bbaf2434 CUDA: add support for specifying an explicit host compiler. a92f8d96 CUDA: Enable header dependency scanning. ec6ce623 CUDA: State that cuda has preprocessor output and can generate assembly. 4f5155f6 CUDA: We now properly perform CUDA compiler identification. ...
| * CUDA: Add support for CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITYRobert Maynard2016-11-141-0/+1
| |
| * CUDA: Add support language levels (98/11)Robert Maynard2016-11-141-0/+3
| |
* | Allow NO_SYSTEM_FROM_IMPORTED on imported INTERFACE librariesBrad King2016-11-211-1/+4
|/ | | | | | | | | Imported INTERFACE libraries can specify include directories via `INTERFACE_INCLUDE_DIRECTORIES` so the default behavior of treating them as system include directories applies. Allow users to turn this off by setting `NO_SYSTEM_FROM_IMPORTED` on such targets. Closes: #16443
* Merge topic 'imported-interface-libname'Brad King2016-11-091-18/+53
|\ | | | | | | | | | | | | | | 09cda9d5 Allow imported INTERFACE libraries to specify a link library name 1d1f1eeb cmTarget: Refactor GetMappedConfig to choose location property up front 479932fa cmTarget: Add comment clarifying interface library special case 925e4270 cmTarget: Clarify comments in GetMappedConfig
| * Allow imported INTERFACE libraries to specify a link library nameBrad King2016-11-091-12/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library name to be placed on the link line in place of an interface library since it has no library file of its own. Restrict use of the property to imported `INTERFACE` libraries. This will be particularly useful for find modules that need to provide imported libraries from system SDKs where the full path to the library file is not known. Now such find modules will be able to provide an imported interface library and set `IMPORTED_LIBNAME` to refer to the SDK library by name. Issue: #15267
| * cmTarget: Refactor GetMappedConfig to choose location property up frontBrad King2016-11-031-5/+7
| | | | | | | | | | Store the `IMPORTED_LOCATION` property name in a variable up front to avoid duplicating the string literal.
| * cmTarget: Add comment clarifying interface library special caseBrad King2016-11-031-0/+2
| |
| * cmTarget: Clarify comments in GetMappedConfigBrad King2016-11-031-3/+3
| | | | | | | | | | Clarify comments explaining the availability of a target location (file on disk) to distinguish this from the existence of the target.
* | Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-8/+10
|/
* Introduce CM_UNORDERED_SETDaniel Pfeifer2016-10-241-11/+2
| | | | | Avoid duplicating switch among std::unordered_set, cmsys::hash_set, and std::set.