| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the Apple linker sees -headerpad_max_install_names and
bitcode is enabled with a flag like -fembed-bitcode, it issues a warning
and ignores the -headerpad_max_install_names flag. This causes
unrelated compiler and linker flag checks to fail for valid flags.
In f745e0497e (CheckCompilerFlags: Catch linker warning about ignored
flags, 2022-01-03), we started detecting linker warnings, which caused
a regression for projects that were setting -fembed-bitcode in their
CMAKE_CXX_FLAGS or similar. Prevent that regression by removing
the -headerpad_max_install_names linker flag when we know it will
warn and be ignored anyway.
Fixes: #23390
Issue: #23408
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
To avoid ambiguity on std::string assigment between the following two
cmProp cast operators:
* operator const std::string&() const noexcept
* operator cm::string_view() const noexcept
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Set policy CMP0126 to the value used in the calling project.
It may affect toolchain file behavior.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compile options `--march=<arch>` and `--mcpu=<cpu>` and the
link option `--cpu=<cpu>` are automatically added by CMake based
on `CMAKE_SYSTEM_PROCESSOR` or `CMAKE_SYSTEM_ARCH`. But this is not
sufficient, because armclang also supports enabling or disabling
features using `+<feature>`:
-mcpu=<name>[+[no]<feature>+...]
For example:
-mcpu=cortex-a57+nocrypto+nofp+nosimd+crc
(Reference: https://developer.arm.com/documentation/dui0774/k/Compiler-Command-line-Options/-mcpu?lang=en)
The problem is, even if a project adds a flag with features it needs,
CMake still adds flags, resulting in code that is compiled with wrong
CPU features and unable to run.
Add policy `CMP0123` to not automatically add compile or link options,
and let projects set them instead.
Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21173
|
| |
|
|
|
|
|
|
|
|
|
| |
The target property `ISPC_HEADER_SUFFIX` and associated global
variable now can control the suffix used when generating the
C/C++ interoperability ISPC headers.
In addition the default suffix is now "_ispc.h" which matches the
common convention that the ISPC compiler team uses and recommends.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
c4e890946a try_compile: consistently add language properties
0e16da8233 cmCoreTryCompile use anonymous namespace instead of static
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4895
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It was very easy to forgot to add all the possible language
properties that try_compile might need. Refactored the code
to make it harder to skip flags.
This changes adds the missing language properties for
the CUDA, Fortran, OBJC, OBJCXX, and Swift languages:
- CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN
- CMAKE_<LANG>_COMPILER_TARGET
- CMAKE_<LANG>_LINK_NO_PIE_SUPPORTED
- CMAKE_<LANG>_PIE_SUPPORTED
|
| | |
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| | |
a9a258c302 try_compile: Do not try to remove '.nfs*' files
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !4913
|
| |
| |
| |
| |
| |
| |
| | |
These files are part of the NFS implementation and should not be
removed. They will automatically disappear when NFS is done with them.
Fixes: #20844
|
|/
|
|
|
|
|
| |
cmCoreTryCompile had significant code duplication around handling
languages that offer standard levels. This refactoring reduces
the complexity and makes it easier to add new languages in the
future.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit e98588aaba (CUDA: Add CUDA_ARCHITECTURES target property,
2020-03-12), `CMAKE_CUDA_ARCHITECTURES` is both initialized and required
by policy CMP0104's `NEW` behavior. Inside a `try_compile` project we
use `cmake_minimum_required(VERSION ...)` with the current running
version of CMake. Now that our version number is 3.18, `CMP0104` gets
set to `NEW` in the `try_compile`. If the outer projects does not set
the policy then `CMAKE_CUDA_ARCHITECTURES` is not available and the
`try_compile` fails to generate.
Teach `try_compile` to check the outer project's policy status and
set policy CMP0104 to `OLD` if needed to match.
Fixes: #20794
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Simplifies CUDA target architecture handling.
Required for Clang support as Clang doesn't automatically select a supported architecture.
We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it.
Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC.
Implements #17963.
|
| |
| |
| |
| | |
Required for crosscompile support with Clang.
|
|/ |
|
|
|
|
| |
Fixes: #17522
|
| |
|
|
|
|
| |
Fixes: #19920
|
|
|
|
|
| |
Ensure that we preserve the `CMAKE_Swift_COMPILER_TARGET` variable to
use cross-compilation for testing the Swift compiler if appropriate.
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the code pattern
```
std::vector<std::string> args;
cmExpandList(valueStr, args, ...)
```
with
```
std::vector<std::string> args = cmExpandedList(valueStr, ...)
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is generated by a python script that uses regular expressions to
search for string concatenation patterns of the kind
```
std::string str = <ARG0>;
str += <ARG1>;
str += <ARG2>;
...
```
and replaces them with a single `cmStrCat` call
```
std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...);
```
If any `<ARGX>` is itself a concatenated string of the kind
```
a + b + c + ...;
```
then `<ARGX>` is split into multiple arguments for the `cmStrCat` call.
If there's a sequence of literals in the `<ARGX>`, then all literals in the
sequence are concatenated and merged into a single literal argument for
the `cmStrCat` call.
Single character strings are converted to single char arguments for
the `cmStrCat` call.
`std::to_string(...)` wrappings are removed from `cmStrCat` arguments,
because it supports numeric types as well as string types.
`arg.substr(x)` arguments to `cmStrCat` are replaced with
`cm::string_view(arg).substr(x)`
|
|
|
|
| |
While at it change some single character additions to be of type char.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
18b0330b86 clang-tidy: Enable performance-inefficient-string-concatenation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3648
|
| |
| |
| |
| |
| |
| |
| | |
Enables the clang-tidy test performance-inefficient-string-concatenation
and replaces all inefficient string concatenations with `cmStrCat`.
Closes: #19555
|
|/
|
|
|
|
|
|
|
|
| |
This adds the following functions to `cmStringAlgorithms`:
- `cmIsSpace`
- `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`)
- `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`)
- `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to
accept `cm::string_view`)
|
|
|
|
|
| |
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value
argument instead of a `const char *`.
Benefits are:
- `std::string` can be passed to `cmMakefile::AddDefinition` directly without
the `c_str()` plus string length recomputation fallback.
- Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at
compile time.
In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid
`std::string::c_str` calls and the `std::string` is passed directly.
Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might
be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
275b6b3194 iOS: Fix try_compile FILE_COPY not to fail
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3272
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When building for iOS, the compiled target is placed into a bundle.
If a single-configuration generator is used, like Makefiles or Ninja,
the try_compile FILE_COPY behavior fails to find the bundle, because
it only looks for the bundle inside a Debug subfolder (presumably
to support a multi-configuration generator like Xcode).
Consider looking for the bundle in the root try_compile folder, as
well as in the location specified by CMAKE_TRY_COMPILE_CONFIGURATION.
Closes: #19211
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Replace our hard-coded defaults for `/MD` and `/MDd` with a first-class
abstraction to select the runtime library from an enumeration of logical
names. We've long hesitated to do this because the idea of "runtime
library selection" 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 flags 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 CMP0091 to provide
compatibility.
Fixes: #19108
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
a1e6b414b9 GHS: Update GHS_BSP_NAME processing
266dadf868 GHS: Print status message regarding GHS_OS_DIR
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3123
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
-- Rename platform script so it runs before initial try_compile() in
project() command.
-- Fix incorrect variable name GHS_OS_DIR_OPTION
-- Remove unnecessary ".*" from REGEX expression for GHS_CANDIDATE_OS_DIRS
-- Forward GHS_OS_DIR_OPTION to try_compile() and preserve trailing
whitespace of the variable.
|