summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'Intel-Fortran-warn-errors'Brad King2022-10-101-3/+7
|\ | | | | | | | | | | | | | | | | 13f3382b1c Intel/IntelLLVM: Fortran has distinct "-Werror"-like flag ab8a0a106e COMPILE_WARNING_AS_ERROR: Fix internal formatting of options table Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7758
| * COMPILE_WARNING_AS_ERROR: Fix internal formatting of options tableBrad King2022-10-071-3/+7
| | | | | | | | | | | | | | | | In commit 76a08cd253 (COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors, 2022-04-21, v3.24.0-rc1~173^2) we formatted the options table entries as command-line string fragments. Since they are part of the `CMAKE_${lang}_COMPILE_OPTIONS_*` tables, they should be formatted as `;`-separated lists of compiler options.
* | MSVC: Add abstraction for debug information formatGlen Chung2022-09-141-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace our hard-coded default for `/Zi` with a first-class abstraction to select the debug information format an enumeration of logical names. We've long hesitated to do this because the idea of "debug information format" touches on related concepts on several platforms. Avoid that scope creep by simply defining an abstraction that applies only when targeting the MSVC ABI on Windows. Removing the old default flag requires a policy because existing projects may rely on string processing to edit them and choose a runtime library under the old behavior. Add policy CMP0141 to provide compatibility. Fixes: #10189
* | target_*: Fix cross-directory call backtracesBrad King2022-08-221-1/+2
| | | | | | | | | | | | | | Record the call-site backtrace, not the current backtrace of the target's directory. Fixes: #23873
* | Xcode: don't set SKIP_PRECOMPILE_HEADERS when source has no languageAndrey Filipenkov2022-08-111-1/+3
| | | | | | | | | | | | Resources that should go into "Copy Bundle Resources" build phase are added as source files but don't have an associated language Fixes: #23821
* | CUDA: Add Device LTO support for nvccRobert Maynard2022-07-221-4/+21
|/ | | | Fixes #22200
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-3/+3
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* Ninja: Avoid duplicating /DEF: linker flag with MSVC toolsBrad King2022-05-311-16/+2
| | | | | | | | | | In commit 9a0d5a828a (Ninja: add /DEF: flag to linker call, 2012-03-10, v2.8.8~22^2~7) the logic should have been added to `GetTargetFlags` in place of the older logic in that method from commit 7cef36c628 (ENH: add the ability to generate custom commands for a language that is not supported by an IDE, 2004-10-21, v2.4.0~2655). Fixes: #23570
* cmLocalGenerator: Adopt AppendModuleDefinitionFlag methodBrad King2022-05-311-0/+26
| | | | Migrate from `cmCommonTargetGenerator::AddModuleDefinitionFlag`.
* Merge topic 'ignore-werror-command-arg'Brad King2022-05-191-5/+7
|\ | | | | | | | | | | | | 65f7053d6c COMPILE_WARNING_AS_ERROR: Add command-line option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7268
| * COMPILE_WARNING_AS_ERROR: Add command-line optionMartin Duffy2022-05-181-5/+7
| | | | | | | | | | | | | | Add command-line option `--compile-no-warning-as-error` to ignore value of `COMPILE_WARNING_AS_ERROR`. Issue: #19085
* | Merge topic 'werror-property'Brad King2022-05-101-0/+9
|\ \ | |/ | | | | | | | | | | | | | | 76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Acked-by: Michael Hirsch <michael@scivision.dev> Merge-request: !7187
| * COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errorsMartin Duffy2022-05-061-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add `COMPILE_WARNING_AS_ERROR` target property and supporting `CMAKE_COMPILE_WARNING_AS_ERROR` variable. `COMPILE_WARNING_AS_ERROR` is initialized by `CMAKE_COMPILE_WARNING_AS_ERROR`. It is a boolean variable. If it is true, it expands to a different flag depending on the compiler such that any warnings at compile will be treated as errors. Supports compiler ids that I could find a relevant flag for.
* | OpenWatcom: Allow specifying the runtime libraryCameron Cawley2022-05-061-0/+32
| | | | | | | | | | | | | | | | Add a `CMAKE_WATCOM_RUNTIME_LIBRARY` variable to control the runtime library selection. Add policy CMP0136 to switch to in place of the old hard-coded default flags. Fixes: #23178
* | Merge topic 'xcode-pch'Brad King2022-04-121-4/+6
|\ \ | |/ |/| | | | | | | | | | | | | 476c6a8910 PCH: Fix Xcode non-pch language exclusion fcf1fcfd0c Tests: Ignore all classes in Xcode internal objc warnings Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7166
| * PCH: Fix Xcode non-pch language exclusionCristian Adam2022-04-111-4/+6
| | | | | | | | | | | | | | Fix a regression caused by commit bbcdac4e5d (PCH: Fix all-language precompile header support in Xcode, 2021-08-07, v3.22.0-rc1~140^2). Fixes: #23138
| * Merge topic 'nmc-reuse-from' into release-3.22Brad King2021-11-091-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | 244550997f PCH: Fixed Ninja Multi-Config and REUSE_FROM for MSVC Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6713
* | | color: Introduce CMAKE_COLOR_DIAGNOSTICS variableSemyon Kolton2022-03-081-0/+24
| | | | | | | | | | | | | | | | | | | | | Add a variable to control both makefile color messages and compiler color diagnostics. Fixes: #15502
* | | cmExpandListWithBacktrace: add handling of empty elements.Marc Chevrier2022-02-061-2/+2
| | |
* | | Merge topic 'link-interface-direct'Brad King2022-01-311-0/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f3ad061858 Add usage requirements to update direct link dependencies 193a999cd5 cmTarget: Add INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage 22d5427aa6 cmGeneratorTarget: Add LookupLinkItem option to consider own target name f3d2eab36a cmGeneratorTarget: Fix link interface caching of partial results d75ab9d066 cmGeneratorTarget: Clarify CMP0022 logic in ComputeLinkInterfaceLibraries f3e9e03fe0 cmGeneratorTarget: Simplify CMP0022 warning check 216aa14997 cmGeneratorTarget: Return early from ExpandLinkItems with no items 1bc98371d1 Tests: Remove unnecessary policy setting from ObjectLibrary test ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6886
| * | | PCH: Clear link interface cache when adding PCH object to itBrad King2022-01-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On platforms using `CMAKE_LINK_PCH`, the implementation of `PRECOMPILE_HEADERS_REUSE_FROM`, when re-using the PCH from one object library in another, adds a PCH object file to the link interface. Clear any cached link interface to ensure it is used.
* | | | Shorten object name even if still longer than CMAKE_OBJECT_PATH_MAXNick Little2022-01-281-12/+18
|/ / / | | | | | | | | | | | | | | | | | | In some cases the shortened path may end up working in practice, even if it is over CMAKE_OBJECT_PATH_MAX, where the original path does not. If the original path is too long, do the MD5 substitution whenever it makes the path shorter. Retain the warning if it is still too long.
* | | cmCustomCommand: Track main dependency explicitlyNAKAMURA Takumi2021-12-141-20/+8
| | | | | | | | | | | | | | | | | | | | | Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
* | | cmLocalGenerator: Remove unused IncludePathStyle infrastructureBrad King2021-12-011-6/+3
| | | | | | | | | | | | | | | | | | It is unused since commit c564a3e3ff (Ninja: Always compile sources using absolute paths, 2021-05-19, v3.21.0-rc1~129^2), which left behind a FIXME comment to eventually remove it.
* | | cmLocalGenerator: Simplify Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-95/+21
| | |
* | | cmMakefile: Simplify detail:::Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-112/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | Note 1: `detail::AddCustomCommandToTarget()` resets cc, since cc is not moved away. Note 2: In `detail::AddUtilityCommand()`, a few vars are preserved before using. Their refs will be alive in most cases, but cc might be destroyed in the future.
* | | cmCustomCommand: Move constructor arguments to individual settersNAKAMURA Takumi2021-11-181-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | Make `cmCustomCommand` have just only default constructor. Use each setter instead. This follows the builder pattern. Introduce `cc::SetOutputs(std::string output)`. This will be used later, as substitution for `cc::SetOutputs({output})`.
* | | Unity Build: Fix per-config sources in multi-config generatorsBrad King2021-11-111-29/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Single-config generators already support unity builds with per-config sources because they compute sources using `CMAKE_BUILD_TYPE` as the configuration. Each original source is either included in the unity build source, or not. Teach multi-config generators to compute the list of sources for inclusion in unity builds using all configurations. Previously they only used the empty string as the configuration. Each original source may be included in some configurations, but not others. Use preprocessor conditions to guard their inclusion when necessary. Fixes: #22892
* | | cmLocalGenerator: Add dedicated types to hold unity source infoBrad King2021-11-111-36/+53
| | |
* | | cmLocalGenerator: Clarify name of method to write unity source include linesBrad King2021-11-101-5/+7
| | |
* | | cmLocalGenerator: Simplify unity source copy-if-different logicBrad King2021-11-101-13/+8
| | |
* | | cmLocalGenerator: De-duplicate unity source file generationBrad King2021-11-101-40/+32
| | |
* | | Merge topic 'cuda_clang_cmp0105'Brad King2021-11-091-5/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4707ecbe6f CUDA: Support CMP0105 on Clang 15fde4c420 CUDA: Use local shorthands for variables in Clang device link code cf7e68087d CUDA: Avoid unnecessary allocation and GetLinkLanguage() 5b0693411e CUDA: Ignore USE_WATCOM_QUOTE for device link rules Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6709
| * | | CUDA: Avoid unnecessary allocation and GetLinkLanguage()Raul Tambre2021-11-071-5/+3
| | | | | | | | | | | | | | | | | | | | There's no reason to allocate the cmNinjaLinkLineDeviceComputer on the heap. We can also assume the link language as CUDA in cmLocalGenerator::GetDeviceLinkFlags().
* | | | Merge topic 'nmc-reuse-from'Brad King2021-11-091-3/+3
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | 244550997f PCH: Fixed Ninja Multi-Config and REUSE_FROM for MSVC Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6713
| * | | PCH: Fixed Ninja Multi-Config and REUSE_FROM for MSVCCristian Adam2021-11-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The copy_idb_pdb.cmake script would be executed for every configuration for all configurations. Debug would still want to get the RelWithDebInfo files, and the other way around.
* | | | Merge topic 'msvc-pch-reuse-config'Brad King2021-11-091-2/+2
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | | | | 95fa27d94d PCH: Fix REUSE_FROM when Debug and RelWithDebInfo configs differ Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6712
| * | PCH: Fix REUSE_FROM when Debug and RelWithDebInfo configs differCristian Adam2021-11-081-2/+2
| |/ | | | | | | | | | | | | If the Debug configuration contains `/ZI` but the RelWithDebInfo doesn't then the copy_pdb_idb.cmake script will cause problems due to the fact that it was common for both configurations but they are incompatible with each other.
* | bootstrap: Do not declare cmSystemTools functions that are not implementedBrad King2021-10-271-1/+4
| | | | | | | | Convert runtime error messages into compile-time errors.
* | Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-2/+2
|/
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-2/+3
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-81/+82
|
* remove cmToCStr functionMarc Chevrier2021-09-191-5/+4
|
* cmSystemTools::VersionCompare: use std::string for argumentsMarc Chevrier2021-09-171-6/+6
|
* PCH: MSVC: Restrict OBJECT library INTERFACE_LINK_LIBRARIES usageCristian Adam2021-09-151-1/+2
| | | | | | | | The pch object file could cause problems when the reused pch is passed through an OBJECT library, which would use INTERFACE_LINK_LIBRARIES to link the pch object file. Fixes: #22630
* Merge topic 'pch-xcode-multiple-languages'Brad King2021-09-141-0/+15
|\ | | | | | | | | | | | | | | bbcdac4e5d PCH: Fix all-language precompile header support in Xcode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6435
| * PCH: Fix all-language precompile header support in XcodeCristian Adam2021-09-131-0/+15
| | | | | | | | Fixes: #22384
* | Refactor: Use new SetProperty signaturesMarc Chevrier2021-08-251-6/+6
| |
* | Refactor: reduce cmToCStr usageMarc Chevrier2021-08-191-17/+15
|/
* Merge topic 'LWYU-externalization'Brad King2021-07-121-0/+24
|\ | | | | | | | | | | | | | | | | 14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration 9c5132a586 PGI: Fix "LINKER:" prefix generated separator 8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6306