Commit Graph

4196 Commits

Author SHA1 Message Date
Brad King d21b391cde Merge topic 'file-TIMESTAMP-relative-path'
733801b57f file(TIMESTAMP): Interpret relative paths w.r.t. the source tree

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7440
2022-07-07 09:22:11 -04:00
Brad King 3b1d54506f Merge topic 'generator-makefiles-deps-messages-VERBOSE'
9480ced81a Makefiles generator: dependencies messages in verbose mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7456
2022-07-07 09:14:23 -04:00
Brad King 24631689f0 Merge topic 'genex-LINK_LIBRARY-check-supported-properties'
913ea78d7a Genex LINK_LIBRARY and LINK_GROUP: check supported properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7454
2022-07-07 09:07:01 -04:00
Marc Chevrier 9480ced81a Makefiles generator: dependencies messages in verbose mode
Fixes: #23689
2022-07-06 17:40:08 +02:00
Marc Chevrier 913ea78d7a Genex LINK_LIBRARY and LINK_GROUP: check supported properties
Refines check for properties supporting these genex.
Enhance error message.

Fixes: #23699
2022-07-06 16:15:43 +02:00
TheBrokenRail 733801b57f file(TIMESTAMP): Interpret relative paths w.r.t. the source tree
Fixes: #23610
2022-07-06 09:28:21 -04:00
Brad King ad2e7f3c53 Merge topic 'command-arg-parser-optional'
bff468c988 cmFileCommand: Use cm::optional for keyword argument presence
2586afa31b cmCTest*Command:: Use cm::optional for keyword argument presence
5446b15c5c cmInstallCommand: Use cm::optional for keyword argument presence
298f226cb4 cmExportCommand: Use cm::optional for keyword argument presence
0a4c5164c9 cmArgumentParser: Offer cm::optional bindings to capture keyword presence
f3dbf4b89d cmArgumentParser: Remove unnecessary local names for common types
2873f41bd9 cmArgumentParser: Require callers to consider unparsed arguments
1ee5a4a548 cmArgumentParser: Avoid allocating copies of keyword strings
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7450
2022-07-06 09:22:38 -04:00
Brad King b80ccea686 Merge topic 'enable_language-deduplicate'
e3c8012ccd Help: Document enable_language accepting multiple languages
b4fd385c9b cmMakefile: Dedupe languages when enabling them
66bfe14309 cmMakefile: Refactor parameter and variable names for EnableLanguage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7426
2022-07-06 09:16:34 -04:00
Brad King 18824a9a2d Merge topic 'genex-LINK_LIBRARY-fix-generation'
e8792da04b genex-LINK_LIBRARY: ensure correct generation inside LINK_GROUP genex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7443
2022-07-06 09:13:06 -04:00
Brad King cf6225af3d Merge topic 'vs-test-arm64'
190e3b93cd Tests: Exclude win/arm64 tests with CMAKE_VS_PLATFORM_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7449
2022-07-06 08:55:09 -04:00
Brad King db256a5154 Merge topic 'pkgconfig-when-spaces-in-path'
bcdac84961 Tests/FindPkgConfig: correctly handle broken pkg-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7435
2022-07-06 08:51:58 -04:00
Brad King bff468c988 cmFileCommand: Use cm::optional for keyword argument presence 2022-07-05 16:56:06 -04:00
Brad King fd3ed41109 file(GENERATE): Add test case covering use of both INPUT and CONTENT
We have long incorrectly accepted both of these together, and used only
the first one.  Add a test to preserve compatibility.
2022-07-05 16:30:55 -04:00
Brad King f713146a10 file(CONFIGURE): Add test cases covering missing mandatory options 2022-07-05 15:22:01 -04:00
Niyas Sait 190e3b93cd Tests: Exclude win/arm64 tests with CMAKE_VS_PLATFORM_NAME 2022-07-05 20:12:09 +01:00
Brad King aa1eaf6b8a Merge topic 'nvhpc-Werror'
35ec676ace NVHPC: warnings as error flag is "-Werror"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7415
2022-07-05 10:32:55 -04:00
Brad King c70ed631f7 Merge topic 'nvhpc-Werror' into release-3.24
35ec676ace NVHPC: warnings as error flag is "-Werror"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7415
2022-07-05 10:32:54 -04:00
Brad King d5772027c2 Merge topic 'add_nvcc_compile_warning_support'
cd324110d2 CUDA: NVCC support for COMPILE_WARNING_AS_ERROR target property
2e9ac1d272 Tests: Refactor warn on error tests to support multiple languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7417
2022-07-05 10:31:23 -04:00
Brad King 6fee995256 Merge topic 'add_nvcc_compile_warning_support' into release-3.24
cd324110d2 CUDA: NVCC support for COMPILE_WARNING_AS_ERROR target property
2e9ac1d272 Tests: Refactor warn on error tests to support multiple languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7417
2022-07-05 10:31:22 -04:00
Marc Chevrier e8792da04b genex-LINK_LIBRARY: ensure correct generation inside LINK_GROUP genex
This fix ensures the following pattern is correctly handled:
$<LINK_GROUP:group_feat,$<LINK_LIBRARY:lib_feat,mylib>>

With:
CMAKE_LINK_GROUP_USING_group_feat = "—START_GROUP" "—END_GROUP"
CMAKE_LINK_LIBRARY_USING_lib_feat = "—PREFIX" "—LINK <LIBRARY>" "—SUFFIX"

Before the fix, we get the following generation:
—START_GROUP —PREFIX —LINK /path/to/mylib —END_GROUP —SUFFIX
—END_GROUP and —SUFFIX are in the wrong order

After the fix, we get the correct order:
—START_GROUP —PREFIX —LINK /path/to/mylib —SUFFIX —END_GROUP
2022-07-05 10:00:04 +02:00
makise-homura bcdac84961 Tests/FindPkgConfig: correctly handle broken pkg-config
Older versions of pkg-config (e.g. 0.21 and 0.22) do not
handle correctly spaces in paths specified in .pc files.
It breaks RunCMake.FindPkgConfig test, if CMake is built
inside path containing spaces. In this case, we check if
we're inside such path, and if pkg-config is broken; and
if both are true, test is to be skipped.
2022-07-01 19:22:59 +03:00
Brad King 27a103e8bc Merge topic 'file-archive-args'
7c83265e59 file(ARCHIVE*): Simplify acceptance of empty list arguments
dfff470d15 file(ARCHIVE*): Add test for keyword arguments with missing values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7427
2022-07-01 08:24:36 -04:00
Brad King 34d746e419 Merge topic 'genex-TARGET_BUNDLE_DIR_NAME'
8bd98b8117 Genex: Fix TARGET_BUNDLE_DIR_NAME incorrect extension

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7428
2022-07-01 08:19:36 -04:00
Ben Leadbetter 8bd98b8117 Genex: Fix TARGET_BUNDLE_DIR_NAME incorrect extension
Fix the genex from commit 997af2e1a6 (Genex: Add TARGET_BUNDLE_DIR_NAME,
2022-04-14, v3.24.0-rc1~233^2) to use the correct bundle directory
extension for each bundle type.

Fixes: #23683
2022-07-01 08:18:10 -04:00
Robert Maynard 35ec676ace NVHPC: warnings as error flag is "-Werror" 2022-07-01 08:05:19 -04:00
Robert Maynard cd324110d2 CUDA: NVCC support for COMPILE_WARNING_AS_ERROR target property 2022-07-01 08:04:54 -04:00
friendlyanon b4fd385c9b cmMakefile: Dedupe languages when enabling them
cmMakefile::EnableLanguage() now deduplicates the languages argument and
emits an author warning listing the languages that were defined multiple
times in a single call.

Fixes: #23596
2022-06-30 23:37:05 +02:00
Brad King 5a460f3243 Merge topic 'file-set-crash'
3fee5398bd install(EXPORT): Check for missing file sets at generate time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7420
2022-06-30 08:20:24 -04:00
Brad King 6bc597b30e Merge topic 'file-set-crash' into release-3.24
3fee5398bd install(EXPORT): Check for missing file sets at generate time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7420
2022-06-30 08:20:23 -04:00
Brad King dfff470d15 file(ARCHIVE*): Add test for keyword arguments with missing values 2022-06-29 17:43:41 -04:00
Kyle Edwards 3fee5398bd install(EXPORT): Check for missing file sets at generate time
Missing file sets were originally checked at configure time in
install(TARGETS ... EXPORT), but were not checked at generate time. If
a file set was added after install(TARGETS ... EXPORT) was called,
an abortion error was thrown. Check again at generate time to gracefully
display an error message instead of crashing.

Fixes: #23680
2022-06-29 15:05:32 -04:00
Robert Maynard 2e9ac1d272 Tests: Refactor warn on error tests to support multiple languages 2022-06-29 11:50:34 -04:00
Brad King b1d8141534 Merge topic 'log_level_command'
23bbac941a Add cmake_language(GET_MESSAGE_LOG_LEVEL) sub command
2b6ef864e0 Move LogLevel enum out of cmake.h header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7348
2022-06-29 08:52:13 -04:00
Alexandru Croitor 23bbac941a Add cmake_language(GET_MESSAGE_LOG_LEVEL) sub command
The new sub-command writes a string representation of the
current log level to the output variable given to the
sub-command.

Given that the log-level might be set either via the --log-level
command line option or via the CMAKE_MESSAGE_LOG_LEVEL
cache / regular variables, the priority for each of the log level
sources is as follows, with the first one being the highest:
1) --log-level
2) CMAKE_MESSAGE_LOG_LEVEL regular variable
3) CMAKE_MESSAGE_LOG_LEVEL cache variable
4) default log level (STATUS)

Fixes: #23572
2022-06-28 16:03:22 +02:00
Raul Tambre e1adddc74e RunCMake/CXXModules/NoCXX20: Force older standard
Compile features ensure a compiler is aware of a standard version, but the one
actually used may be newer. The test relies on the standard chosen being
pre-C++20, so force C++17 explicitly.

This was exposed by a nightly bot that has a compiler defaulting to C++23. The
test would've broken anyway in a few years once GCC or Clang upped their
default.
2022-06-28 09:27:29 -04:00
Raul Tambre 3f7ebf9354 RunCMake/CTestTimeout: Include sched.h for pid_t
ISO C modes in Clang don't enable modern POSIX standards.
Include sched.h to define pid_t in such modes.
2022-06-27 20:34:53 +03:00
Brad King 5d8289116d Merge topic 'vs-compile-batching'
9a0a94fdaa VS: Add variable to to turn off Visual Studio compile batching
a7ebb73929 Help: Improve formatting in VS_NO_COMPILE_BATCHING docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7405
2022-06-23 09:23:56 -04:00
Brad King fd83847b14 Merge topic 'vs-compile-batching' into release-3.24
9a0a94fdaa VS: Add variable to to turn off Visual Studio compile batching
a7ebb73929 Help: Improve formatting in VS_NO_COMPILE_BATCHING docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7405
2022-06-23 09:23:55 -04:00
Brad King d1e2090526 Merge topic 'revert-pkgconfig-static-libs'
7e4adcac82 FindPkgConfig: Revert "Populate _STATIC_LINK_LIBRARIES. Add STATIC_TARGET."

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7402
2022-06-23 09:21:26 -04:00
Brad King 9a0a94fdaa VS: Add variable to to turn off Visual Studio compile batching
Extend the change from commit b764c7c273 (VS: Add property to turn off
Visual Studio compile batching, 2022-02-07, v3.24.0-rc1~710^2) by
adding a variable to initialize the property on every target.

Issue: #23179
Fixes: #23639
2022-06-22 12:07:03 -04:00
Brad King 7e4adcac82 FindPkgConfig: Revert "Populate _STATIC_LINK_LIBRARIES. Add STATIC_TARGET."
Revert commit 020976d637 (FindPkgConfig: Populate
_STATIC_LINK_LIBRARIES. Add STATIC_TARGET., 2021-12-31,
v3.24.0-rc1~105^2).  Several regressions have been reported.
Revert the feature pending further discussion and design work.

Issue: #21714
Fixes: #23642
2022-06-22 10:13:00 -04:00
Brad King d94e09ec88 Merge topic 'cpp-named-module-file-sets'
07bc3b07ec gitlab-ci: test C++ modules using GCC
1b2270aa4e ci: add a Docker image to test out C++ modules with GCC
8c5a53096a Tests/RunCMake/CXXModules: add module-using examples
4151547e2f cmGlobalNinjaGenerator: use `cmModuleMapper` implementation
b43bdaff3c cmCxxModuleMapper: implement support for GCC's module map format
02d0f0e752 cmCxxModuleMapper: add source to handle module mapper contents
a046a45aad cmGlobalNinjaGenerator: add a TODO for header units
386465bf83 cmTarget: add support for C++ module fileset types
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7369
2022-06-17 11:35:12 -04:00
Ben Boeckel 8c5a53096a Tests/RunCMake/CXXModules: add module-using examples
This includes a number of examples that should work for various levels
of support in a compiler.

There are a number of tests which are gated on various features in the
compilers. To enable the tests, set `CMake_TEST_MODULE_COMPILATION` to a
comma-separated (to avoid `;`-escaping problems) to the list of features
which are supported:

  - `named`: Named modules are supported.
  - `shared`: Shared libraries with module usage at the API boundary are
    supported.
  - `partitions`: Named module partitions are supported.
  - `internal_partitions`: Named module internal partitions are
    supported.

Additionally, a `CMake_TEST_MODULE_COMPILATION_RULES` file must be
passed which contains the rules for how to build modules using the
provided compiler. It will be included in the tests to provide these
rules. To verify that the file provided works as intended, it must set
`CMake_TEST_CXXModules_UUID` to a specific version to indicate that it
is an expected file.
2022-06-16 10:28:34 -04:00
Ben Boeckel 386465bf83 cmTarget: add support for C++ module fileset types
C++ modules have two variants which are of importance to CMake:

  - `CXX_MODULES`: interface modules (those using `export module M;`,
    `export module M:part;`, or `module M:internal_part;`)
  - `CXX_MODULE_HEADER_UNITS`: importable header units

Creating C++ modules or partitions are *not* supported in any other
source listing. This is because the source files must be installed (so
their scope matters), but not part of usage requirements (what it means
for a module source to be injected into a consumer is not clear at this
moment). Due to the way `FILE_SET` works with scopes, they are a perfect
fit as long as `INTERFACE` is not allowed (which it is not).
2022-06-16 10:28:34 -04:00
Brad King 7eddfed10f Merge topic 'xcode-launch-mode'
a1a0ae3ad4 Xcode: Add Xcode SCHEME control for 'Launch' control

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7355
2022-06-16 08:59:51 -04:00
Brad King d0ea344b03 Merge topic '23376-add-compile-properties-to-csharp-sdk-projects'
ba6cecea8e VS: Add compile properties to .NET Sdk projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7373
2022-06-16 08:59:02 -04:00
Harry Mallon a1a0ae3ad4 Xcode: Add Xcode SCHEME control for 'Launch' control 2022-06-15 19:02:56 +01:00
Maxime Raynaud ba6cecea8e VS: Add compile properties to .NET Sdk projects 2022-06-15 10:59:16 -04:00
Brad King 85dc7c763a Merge topic 'find_item-validation-function'
f3b5a7d6df find_(program,library,file,path): add validation function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7364
2022-06-15 09:59:12 -04:00
Marc Chevrier f3b5a7d6df find_(program,library,file,path): add validation function
Fixes: #23603
2022-06-14 16:17:46 -04:00