summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-10/+15
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * 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.
* Add generator expression support to PDB_OUTPUT_DIRECTORY target propertyMarian Klymov2018-05-211-2/+13
| | | | Fixes: #16365
* cmGeneratorTarget: make GetManagedType() return 'Native' for static targetsMichael Stürmer2018-05-071-3/+5
|
* cmGeneratorTarget: change GetManagedType() result if language is CSharpMichael Stürmer2018-04-231-3/+5
|
* cmGeneratorTarget: add handling of managed assemblies to HasImportLibrary()Michael Stürmer2018-04-051-1/+4
|
* cmGeneratorTarget: Make import library checks config-awareMichael Stürmer2018-04-051-5/+6
|
* cmGeneratorTarget: add GetManagedType() and CheckManagedType() methodsMichael Stürmer2018-04-051-0/+56
|
* cmGeneratorTarget: add HasLanguage() as wrapper for GetLanguages()Michael Stürmer2018-04-051-0/+12
|
* Merge topic 'compile-options-shell'Brad King2018-03-151-5/+17
|\ | | | | | | | | | | | | ce0b983216 target_compile_options: Add syntax to specify shell strings Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1841
| * target_compile_options: Add syntax to specify shell stringsBrad King2018-03-141-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Options specified via `COMPILE_OPTIONS` and `INTERFACE_COMPILE_OPTIONS` are deduplicated, but individual options can legitimately be duplicated when grouped with other options, e.g. -D A -D B After deduplication that becomes `-D A B`. Therefore we need a way to treat groups of options as units during deduplication. A simple approach is to specify each group as one option, e.g. "-D A" "-D B" However, that conflicts with options that legitimately have spaces. To break this ambiguity, add a `SHELL:` prefix syntax to specify that an option should be parsed like shell command line arguments after deduplication, e.g. "SHELL:-D A" "SHELL:-D B" These will survive deduplication intact, and then be parsed to produce `-D A -D B` on the final command line. Fixes: #15826
* | Merge topic 'genex-COMPILE_LANGUAGE-system-include'Brad King2018-03-131-6/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | 1b5e52fd65 Genex: Fix COMPILE_LANGUAGE propagation through try_compile 2deb9b7f34 Genex: Fix COMPILE_LANGUAGE in SYSTEM include directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1844
| * | Genex: Fix COMPILE_LANGUAGE in SYSTEM include directoriesBrad King2018-03-121-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating `INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the compile language through to the generator expression evaluator so that it can support `$<COMPILE_LANGUAGE:...>`. Fixes: #17811
* | | Identify DLL platforms via CMAKE_IMPORT_LIBRARY_SUFFIXStephan Szabo2018-03-091-2/+2
| |/ |/| | | | | | | | | | | Use `CMAKE_IMPORT_LIBRARY_SUFFIX` to identify platforms that have DLL import libraries rather than memorizing a list of platform names. Fixes: #16801
* | Merge topic 'object-library-linking'Brad King2018-03-051-27/+41
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7776ce98c3 Tests: Add cases for usage requirements of linked object libs bafe655b11 Help: Document linking behavior of OBJECT libraries 57538224d0 objlib: Link object-files from `OBJECT` libraries. 9a7f039ee7 objlib: Allow `OBJECT` libraries to link to `OBJECT` libraries. dfb6e84082 objlib: Allow other libraries to link to `OBJECT` libraries. 51249e69ea objlib: Allow `OBJECT` libraries to link to other libraries. e22c45d4c9 Tests: Teach RunCMake to ignore AIX ld warnings about GNU atexit Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com> Acked-by: John Drouhard <john@jmdtech.org> Merge-request: !1524
| * | objlib: Link object-files from `OBJECT` libraries.Deniz Bahadir2018-03-011-8/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: This finally links the object-files of the `OBJECT` library from the right-hand side of `target_link_libraries` to the target on the left-hand side. However, this will only happen with directly linked `OBJECT` libraries, not with `OBJECT` libraries "linked" through property `INTERFACE_LINK_LIBRARIES` of a target on the right-hand side! Fixes: #14778
| * | objlib: Allow `OBJECT` libraries to link to `OBJECT` libraries.Deniz Bahadir2018-03-011-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: This still does not link the object-files of the `OBJECT` library from the right-hand side of `target_link_libraries` to the target on the left-hand side. (In this particular case of another `OBJECT` library on the left-hand side this would not make any sense anyway. The target on the left-hand side has no link-step.) Issue: #14778
| * | objlib: Allow other libraries to link to `OBJECT` libraries.Deniz Bahadir2018-03-011-16/+7
| |/ | | | | | | | | | | | | | | Note: This only allows `OBJECT` libraries to be on the right-hand side of `target_link_libraries` but still does not link its object-files to the target on the left-hand side. Issue: #14778
* | Do not generate rules for .def generation where not supportedBrad King2018-02-281-0/+5
|/ | | | | | | | | | | | | | Our `cmake -E __create_def` helper used for `WINDOWS_EXPORT_ALL_SYMBOLS` and merging of multiple `.def` files is available only with CMake hosted on Windows. However, we may generate use of it on other platforms since commit v3.9.0-rc1~405^2 (Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def` files, 2017-03-13) when multiple `.def` files are listed. This results in a build error because the tool doesn't exist. Fix our logic to avoid using the tool on non-Windows platforms. Instead silently ignore all but the first `.def` source as we did before. Issue: #17773
* Merge topic 'std-string-apis'Brad King2018-02-011-5/+5
|\ | | | | | | | | | | | | 653b8946 Reduce raw string pointers usage. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1729
| * Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-5/+5
| | | | | | | | | | | | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* | cmGeneratorTarget: make keyword strings constBen Boeckel2018-01-311-4/+4
|/
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-12/+11
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Merge topic '17431-iphone-deployment-target'Brad King2018-01-081-4/+7
|\ | | | | | | | | | | | | | | 4017bf40 Darwin: Emit deployment target that matches the SDK 8f4663ff Xcode: rename embedded SDK query function Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1447
| * Xcode: rename embedded SDK query functionGregor Jasny2017-12-221-4/+7
| |
* | Various typo fixesLuz Paz2018-01-031-2/+2
|/ | | | Some are user-facing. Others are source comments.
* objlib: fix unchecked insertions in `cmGeneratorTarget::GetLanguages`Pavel Solodovnikov2017-12-201-1/+6
|
* cmGeneratorTarget: remove dead codeMatthias Maennich2017-10-051-1/+1
| | | | explicitLibraries can never be nullptr at this point
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-22/+25
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-9/+9
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-287/+175
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Merge topic 'fix-genex-SOURCES'Brad King2017-09-011-1/+1
|\ | | | | | | | | | | | | 068cc545 Genex: Fix TARGET_PROPERTY value of SOURCES Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1218
| * Genex: Fix TARGET_PROPERTY value of SOURCESBrad King2017-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Refactoring in commit v3.8.0-rc1~445^2~2 (cmTarget: Move sanity checks and computed property access to callers, 2016-10-13) exposed a typo in commit v3.8.0-rc1~445^2~3 (cmGeneratorTarget: Implement cmTargetPropertyComputer interface, 2016-10-13). Together they broke the `$<TARGET_PROPERTY:mytgt,SOURCES>` generator expression in the case that the `SOURCES` target property is populated in part by the `target_sources` command. Add the missing `;`-separator. Fixes: #17243
| * Merge branch 'objlib-own-target-objs' into release-3.9Brad King2017-07-171-0/+11
| |\
* | | clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
| | |
* | | Use C++11 nullptrDaniel Pfeifer2017-08-241-65/+65
| | |
* | | Use C++11 unordered containersDaniel Pfeifer2017-08-221-18/+19
| | |
* | | Autogen: Clear sources meta data cacheSebastian Holtermann2017-08-101-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds cmGeneratorTarget::clearSourcesCache() which clears the cache of precomputed sources lists and object names. The cache gets recomputed on demand. Clearing the cache is necessary in case an OBJECT library gets a source added after a target (ORIGIN) that includes it computed it's external sources cache. This may happen in AUTOMOC when ORIGIN is processed before the OBJECT library which gets a mocs_compilation.cpp file added. Closes #17152 Closes #17139 Closes #17085 Closes #15967
* | | Merge topic 'objlib-own-target-objs'Brad King2017-07-181-0/+11
|\ \ \ | |/ / |/| / | |/ | | | | | | d89e10cd Diagnose object library self-reference Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1053
| * Diagnose object library self-referenceBrad King2017-07-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code add_library(A OBJECT a.c) target_sources(A PRIVATE $<TARGET_OBJECTS:A>) used to crash CMake via infinite recursion while evaluating the generator expression. Then the change in commit v3.9.0-rc1~266^2~1 (cmGeneratorTarget: Replace source classifier implementation, 2017-04-07) avoided the infinite recursion because GetKindedSources now creates a map entry and initializes it once. If it is called again on the same target during that initialization, the partially computed results are returned. This is still wrong but does not crash. Detect and diagnose this case instead. Co-Author: Ben Boeckel <ben.boeckel@kitware.com> Fixes: #16578
* | Android: Always add standard include directories lastBrad King2017-07-131-12/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | The logic added in commit v3.6.0-rc1~30^2 (Add a variable to specify language-wide system include directories, 2016-05-24) to use `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` incorrectly filters them by `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`. Rather than recognizing this, commit v3.8.0-rc1~60^2 (Android: Pass sysroot include directory explicitly, 2017-01-20) worked around the problem by incorrectly removing `/usr/include` from `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` so it worked in `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`. By not filtering out `/usr/include` from user-specified include directories, we allow the code include_directories(${CMAKE_SYSROOT}/usr/include) to place the include directory too early on the command line. Fix support for standard include directories to not be filtered by implicit include directories, and do not remove `/usr/include` from the list of implicit include directories for Android builds. Add a test case to verify that an explicit `/usr/include` is ignored in favor of the standard directory at the end. Fixes: #17059
* IPO: Consider support for each language separatelyBrad King2017-06-141-8/+15
| | | | | | | | | We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and Fortran languages. Do not try to enable support for other languages. Furthermore, each language builds with a different compiler, so check for support by CMake and the compiler for each language independently. Fixes: #16944
* Merge topic 'lint-function-args'Brad King2017-06-051-1/+1
|\ | | | | | | | | | | | | b1ec5dea Pass large types by const&, small types by value Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !927
| * Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-1/+1
| |
* | Provide and use CM_FALLTHROUGHDaniel Pfeifer2017-06-031-3/+8
|/
* Remove second arg: npos in substr usagesPavel Solodovnikov2017-06-011-1/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-3/+3
|
* CMP0069: Suppress warning if we are in 'try_compile'Ruslan Baratov2017-05-101-1/+3
| | | | Fixes: #16855
* Features: Refactor <LANG>_STANDARD updateBrad King2017-05-011-0/+13
| | | | | | | | | In order to support generator expressions in target COMPILE_FEATURES we apply them at generate time. Move this step to the beginning of generation instead of doing it on demand while collecting flags. This avoids repeating the process unnecessarily, and will then allow `cmLocalGenerator::AddCompilerRequirementFlag` to be used any time during generation.
* Merge topic 'clang-tidy'Brad King2017-04-241-37/+29
|\ | | | | | | | | | | | | | | | | | | 73020305 clang-tidy: avoid copy b432e933 clang-tidy: use .empty() to check emptyness 012972a9 clang-tidy: remove reduntant .data() calls b26577c9 clang-tidy: remove else after break and continue Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !734
| * clang-tidy: remove else after break and continueDaniel Pfeifer2017-04-211-37/+29
| |