Commit Graph

971 Commits

Author SHA1 Message Date
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
Sean McBride
37859e3244 Source: Fix clang -Wimplicit-fallthrough warnings 2021-09-28 10:53:54 -04:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
dffa3f485c cmGlobalGenerator::PrintCompilerAdvice: use cmProp as augment 2021-09-19 19:11:07 +02:00
Marc Chevrier
9488f8a7b7 Merge topic 'enh-AddCacheEntry-accepts-new-types'
f84193292c Use new AddCacheEntry signatures
3c2e58eeb8 AddCacheEntry accept cmProp or std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6495
2021-09-10 09:47:39 -04:00
Marc Chevrier
f84193292c Use new AddCacheEntry signatures 2021-09-10 15:46:21 +02:00
Kyle Edwards
ab94c369c9 Refactor: Convert parallel string/backtrace vectors to BT vectors 2021-09-03 09:52:14 -04:00
Marc Chevrier
3941b74de4 Refactor: cmGlobalGenerator::GetGlobalSetting returns cmProp 2021-08-09 18:52:35 +02:00
Marc Chevrier
e5cd39ca80 cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties,
introduce the class cmProp as a replacement from the simple pointer
to std::string instance.
2021-08-08 16:19:08 +02:00
NAKAMURA Takumi
9e9ab61e2f cmGlobalGenerator: Process targets in a stable order
`cmMakefile::Targets` is meant for efficient lookup but does not
have a stable order.  Use `cmMakefile::OrderedTargets` instead.
2021-07-08 15:16:46 -04:00
NAKAMURA Takumi
8a812dde61 cmGlobalGenerator: Use cmMakefile::CreateNewTarget to add global targets
`cmMakefile::CreateNewTarget` updates also `cmMakefile::OrderedTargets`.
2021-07-08 12:17:37 -04:00
Brad King
e216b9bbd3 cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable
When no `CMAKE_BUILD_TYPE` is explicitly specified while creating a new
build tree, check for an environment variable of the same name.

Issue: #20983
2021-06-30 10:55:40 -04:00
Kyle Edwards
f2617cf8e6 Source: Add cmInstallRuntimeDependencySet 2021-06-04 08:52:01 -04:00
Brad King
f0ffb1e2d4 cmGlobalGenerator: Simplify relative path conversion in AddRuleHash
Revert commit 204aecdf82 (cmGlobalGenerator: Port configure-time code to
cmMakefile., 2015-08-02, v3.4.0-rc1~234^2~8).  `AddRuleHash` is
generate-time code.
2021-05-13 12:48:43 -04:00
Brad King
ba7b939831 cmStateDirectory: Rename ConvertToRelPathIf{Not => }Contained
The "Not" in the method name is backward from its logic.
2021-05-12 15:53:37 -04:00
Vitaly Stakhovsky
5e8fa0b7bc Source: Minor code improvements 2021-05-11 11:20:04 -04:00
friendlyanon
4dd4e9dd6c cmGlobalGenerator: Add parallel parameter to GenerateCMakeBuildCommand 2021-05-01 16:08:21 +02:00
Brad King
69ea84ec09 cmGlobalGenerator: Clear list of install components between runs 2021-01-28 12:46:32 -05:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05:00
Brad King
0173cdcc01 Merge topic 'make-GENERATED-visible-from-any-scope'
573d51201a GENERATED prop: Set CMP0118 to NEW for some (unrelated) tests
6624b65b3f GENERATED prop: Add implementation for policy CMP0118 being set to NEW
b14fe704f8 GENERATED prop: Simplify determining the language of a source file
ca4ce458a3 GENERATED prop: Check CMP0118 policy and warn in certain situations
0eb30f175e GENERATED prop: Introducing policy CMP0118 and its documentation
78c8d95605 GENERATED prop: Add some tests before introducing changes with CMP0118
e01527619f Simplify code by calling a function directly instead of duplicating it
75cb8615e9 Fix typo in function name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5308
2020-11-30 12:38:17 -05:00
Deniz Bahadir
6624b65b3f GENERATED prop: Add implementation for policy CMP0118 being set to NEW
* Adding implementation for policy CMP0118 being set to `NEW`.
* Adding new tests for policy CMP0118 being set to `NEW`.
* Checking the `GENERATED` property with `get_source_file_property` or
  `get_property` now always returns exactly `1` or `0`. No other values
  will be returned. Note, that this is a backwards-incompatible change,
  even when policy CMP0118 is unset or set to `OLD`.
* Additionally, as `get_source_file_property` and `get_property` now
  always check if a source-file was marked globally visible, even when
  CMP0118 is unset or set to `OLD`, they possibly return `1` where they
  might have returned `0` before the changes introduced by this commit.
  Note, that this is a backwards-incompatible change, even when policy
  CMP0118 is unset or set to `OLD`.
* As a consequence, the tests for policy CMP0118 being unset or set to
  `OLD` got slightly adjusted, too, to reflect these changes in
  behavior.
2020-11-24 18:16:51 +01:00
Brad King
aee981e208 Merge topic 'fix-find-make-program'
ef91fb02f3 cmGlobalGenerator: FindMakeProgram() at a generator-specific time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Frank Dana <ferdnyc@gmail.com>
Merge-request: !5529
2020-11-24 08:42:33 -05:00
Kyle Edwards
ef91fb02f3 cmGlobalGenerator: FindMakeProgram() at a generator-specific time
d5b5c192 moved FindMakeProgram() to an earlier time, which resulted
in CMAKE_MAKE_PROGRAM not being read from the toolchain file. Change
it to only call FindMakeProgram() early in the specific cases of
Visual Studio and Xcode, and restore the old behavior for all other
generators.

Fixes: #21486
2020-11-23 14:20:08 -05:00
Cengizhan Pasaoglu
bd705788f6 Constify some code as suggested by clang-tidy 2020-10-20 00:04:04 +03:00
Brad King
e8b0359a43 cmake_language: Add signature to DEFER calls to later times
Fixes: #19575
2020-09-29 17:12:33 -04:00
vvs31415
d298ae7470 cmake::GetCacheDefinition: Return cmProp 2020-09-28 09:32:22 -07:00
Brad King
f2daa025e3 {get,set}_property: Add support for referencing binary directories
Index directories by their binary directory path in addition to their
source directory path.

Fixes: #19262
2020-09-23 09:25:42 -04:00
Brad King
a8b3217915 Merge topic 'file-GENERATE-earlier'
aee2c51224 file(GENERATE): Create output file structures for all directories first

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5209
2020-09-11 08:27:12 -04:00
Josef Angstenberger
aee2c51224 file(GENERATE): Create output file structures for all directories first
Since commit 36ded610af (PCH: Generate sources during Compute step,
2019-10-05, v3.16.0-rc1~2^2) the source file lookup is done earlier than
before.  Its parent commit f1fb63b306 (file(GENERATE): Create output
file structures even earlier, 2019-10-07, v3.16.0-rc1~2^2~1) prepared
for that.  However, that commit did not account for generating and
using files in separate subdirectories.

Fix this by evaluating all generated files before adding automatic
files.

Fixes: #21144
2020-09-10 16:13:01 -04:00
Brad King
c4e296a609 cmGlobalGenerator: Compute a global target ordering respecting dependencies
Move this up from `cmGlobalXCodeGenerator`.  It will be useful for all
generators.
2020-09-04 09:31:06 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Brad King
f10682b796 Merge topic 'ispc_lang_support'
5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image
8976817d6d ISPC: Update help documentation to include ISPC
2368f46ba4 ISPC: Support building with the MSVC toolchain
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds
34cc6acc81 Add ISPC compiler support to CMake
419d70d490 Refactor some swift only logic to be re-used by other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5065
2020-09-01 09:15:39 -04:00
Robert Maynard
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 2020-08-28 11:21:31 -04:00
Kyle Edwards
3ef0c40962 WIN32_EXECUTABLE: Add support for generator expressions 2020-08-21 09:17:27 -04:00
Brad King
4daf76e10a Merge topic 'compiler_flags'
f76c20da63 Toolchain: Test compiler initial settings
db486da265 Toolchain: Update documentation for initial compiler flags
deec2f587c Toolchain: Take CMAKE_<lang>_FLAGS_INIT into account during compiler detection
ca899af3e2 Toolchain: Handle repeated invocations of CMake with -DCMAKE_C_COMPILER
12ba89e142 Toolchain: Make `/path/comp;-argn' behave the same as 'comp;-argn'
6f1af899db Toolchain: Capture all arguments from CMAKE_<LANG>_COMPILER
ec1d3bc0b6 cmake: avoid exception when printing "changed variables" message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4136
2020-08-06 11:00:12 -04:00
Fred Baksik
ca899af3e2 Toolchain: Handle repeated invocations of CMake with -DCMAKE_C_COMPILER
Repeated invocations of `cmake ... -DCMAKE_C_COMPILER=gcc` should not
trigger a "You have changed variables" message even though the cache
value of CMAKE_C_COMPILER changes from '/path/to/gcc' to 'gcc'.

Make repeated invocations of `cmake ... -DCMAKE_C_COMPILER=gcc;-pipe`
not trigger the warning by comparing the compiler name portion of the list to
the compiler being used.
2020-07-29 11:51:27 -04:00
Brad King
783c6e0455 Merge topic 'use-nonempty'
f37c14e930 Source: use cmNonempty()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5072
2020-07-29 08:08:02 -04:00
Vitaly Stakhovsky
78357e98a4 Avoid duplicate calls to GetDefinition 2020-07-28 09:12:16 -04:00
Vitaly Stakhovsky
f37c14e930 Source: use cmNonempty() 2020-07-28 08:31:31 -04:00
Brad King
261a2585d9 Merge topic 'cleanup-target-types'
ef796cc743 cmGeneratorTarget: Skip computing link implementation for custom targets
45158b2afe cmGeneratorTarget: Simplify logic in ComputeLinkInterfaceLibraries
d6b1f5704e cmGeneratorTarget: Add missing nullptr checks
7695b67500 cmComputeTargetDepends: Add missing nullptr check
95b5df8646 cmGeneratorTarget: Skip computing languages for custom targets
2f0790df50 Factor out generator checks for filtering on non-compiling targets
422d9a0ab2 Factor out generator checks for filtering out interface libraries
bce82df0aa cmGeneratorTarget: Remove unnecessary target type check in dependency tracing
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5038
2020-07-28 08:26:23 -04:00
Brad King
11cf196fd2 Merge topic 'EXCLUDE_FROM_ALL-genex'
22bd267388 Help: Add release note for EXCLUDE_FROM_ALL genex support
807c8aa9f0 Tests: Simplify RunCMake.ExcludeFromAll single-config case
36743436cf Tests: Fix RunCMake.ExcludeFromAll test program warning
99c131c5a3 cmGlobalGenerator: Fix spelling of EXCLUDE_FROM_ALL in error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5049
2020-07-27 10:40:56 -04:00
Brad King
2f0790df50 Factor out generator checks for filtering on non-compiling targets
Add a `cmGeneratorTarget::CanCompileSources` helper method to tell
generators whether a target might compile anything.
2020-07-23 13:31:45 -04:00
Brad King
422d9a0ab2 Factor out generator checks for filtering out interface libraries
Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell
generators whether a target should participate in the generated build
system.
2020-07-23 13:31:44 -04:00
Brad King
99c131c5a3 cmGlobalGenerator: Fix spelling of EXCLUDE_FROM_ALL in error message 2020-07-23 07:13:36 -04:00
Brad King
634c461b22 cmGlobalGenerator: Simplify CheckTargetsForMissingSources
Use `GetAllConfigSources` instead of collecting all configurations
ourselves.
2020-07-22 13:48:11 -04:00
Joerg Bornemann
2cdaf43d96 Allow generator expressions in the EXCLUDE_FROM_ALL target property
This allows for setting EXCLUDE_FROM_ALL, conditional on the build
configuration. However, only the Ninja Multi-Config generator supports
different property values per config. All other multi-config
generators will yield an error in that situation.

Fixes: #20923
2020-07-21 17:16:26 +02:00
Vitaly Stakhovsky
7156911242 cmIsOn: add overload accepting const std::string* 2020-07-14 08:22:24 -04:00
Robert Maynard
7a969fe21d cmMakefile: Refactor API to better handle empty config values 2020-07-03 07:43:18 -04:00
Kyle Edwards
d5b5c19278 cmGlobalGenerator: FindMakeProgram() before CMakeDetermineSystem
Prior to 147d36c, the build tool was found before the toolset was
selected, but was changed to be found after in order to support a
64-bit MSBuild (introduced in da402a0.) However, a bug was found in
64-bit MSBuild, which resulted in da402a0 being reverted in
f3cedf3 (but 147d36c was not reverted.) Move FindMakeProgram() even
earlier than it was before 147d36c, before CMakeDetermineSystem is
called, so that the Visual Studio Android support can report its
sysroot, giving Android-Determine the information it needs to
inspect the NDK.

When the bug in 64-bit MSBuild is fixed, we will have a chicken-and-
egg problem, but we don't need to worry about it for now.
2020-06-18 15:35:26 -04:00
Justin Goshi
742ff97f80 Refactor language standard computation
Instead of mutating the configure-time cmTarget's properties at generate
time, compute and store it in a cmGeneratorTarget field.
2020-06-16 16:32:34 -07:00