Commit Graph

72110 Commits

Author SHA1 Message Date
Brad King
8580c6bd8d Tests: Teach RunCMake.Emscripten to tolerate emcc cache output
`emcc` may generate messages like `cache:INFO:` to stderr,
which we otherwise expect to be empty.
2025-09-19 09:21:33 -04:00
Brad King
503ab73ee4 Merge topic 'vs-sln'
6a77c80834 cmGlobalVisualStudioGenerator: Consolidate solution generation methods
6b1c101410 cmGlobalVisualStudioGenerator: Adopt more solution generation methods
772cf917c1 cmGlobalVisualStudio71Generator: Remove this now-unnecessary class
3882718872 VS: Decouple solution generation from `.sln` file format
d67e7d2726 VS: Factor out Visual Studio `Version` enumeration
76266f9df6 cmGlobalVisualStudioGenerator: Adopt some solution generation methods
d52eb1d083 cmGlobalVisualStudioGenerator: Remove unused folder support rules
50f87b4bf2 cmGlobalGenerator: Simplify collection of targets under a project()
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11196
2025-09-18 09:06:29 -04:00
Brad King
2d8e464d2f Merge topic 'fbuild_optimize_db'
914a9eea94 FASTBuild: optimize generated file size

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11182
2025-09-18 09:05:04 -04:00
Brad King
917f8b217e Merge topic 'fbuild_more_opts'
99839d1158 FASTBuild: expose more options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11180
2025-09-18 09:03:07 -04:00
Brad King
457eaa831d Merge topic 'fbuild_improve_ide_proj'
9441f6cfb2 FASTBuild: improve IDE project structure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11179
2025-09-18 08:59:56 -04:00
Brad King
7ddd67bd41 Merge topic 'cmp0200-warning'
763aa084b0 CMP0200: Fix crash in configuration selection policy warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11164
2025-09-18 08:52:00 -04:00
Brad King
792f6989e9 Merge topic 'android-ndk-custom-toolchain'
9266d4817d Android: Allow custom compilers with NDK

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11199
2025-09-18 08:49:55 -04:00
Brad King
edc4e31179 Merge topic 'tutorial-3.23'
058e7da541 Tutorial: Add redirect pages for removed steps
b2e3e3e30e Tutorial: Rewrite using conventions enabled by CMake 3.23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11097
2025-09-18 08:46:04 -04:00
Brad King
0a11a8d77e Merge topic 'patch-QT_FOUND'
6a0cf35429 FindQt3, FindQt4: Clarify QT_FOUND result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11198
2025-09-18 08:40:34 -04:00
Brad King
baf695bfb0 Merge topic 'install-object-names-build-short'
b2ebfd7709 shortobj: properly force long names when computing long names
1980e47192 Tests/IntermediateDirStrategy: test install paths when using SHORT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11201
2025-09-18 08:36:12 -04:00
Brad King
13dd58b70e Merge topic 'emscripten-platform'
f2b2bac85d Emscripten: Detect and identify linker invoked by the compiler driver
7f3f6d1ec6 Emscripten: Allow overriding -sMAIN_MODULE and -sSIDE_MODULE linker flags
526c6ff6d2 Emscripten: Drop -sMAIN_MODULE and -sSIDE_MODULE with emsdk toolchain file
644ad91e6a Emscripten: Restore support for emsdk toolchain file and platform module
9cbeb922dd Emscripten: Enable de-duplication of libraries for CMP0156 with LLD
f22d2904e2 Emscripten: Drop unused placeholder from link rule variables
f4da11a5da Emscripten: Select emcc and em++ compilers by default
28bab611c6 Tests: Add RunCMake.Emscripten case for a shared library
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11204
2025-09-18 08:28:53 -04:00
Kitware Robot
aec8b7bad8 CMake Nightly Date Stamp 2025-09-18 00:05:09 -04:00
Brad King
f2b2bac85d Emscripten: Detect and identify linker invoked by the compiler driver 2025-09-17 20:03:48 -04:00
Brad King
7f3f6d1ec6 Emscripten: Allow overriding -sMAIN_MODULE and -sSIDE_MODULE linker flags
Place the flag early on executable link lines so that projects can
override it, e.g., with `-sMAIN_MODULE=2` or `-sMAIN_MODULE=0` via
`target_link_options`.

The `-sSIDE_MODULE` flag already appears early enough on shared library
link lines.

Issue: #27232
2025-09-17 19:54:40 -04:00
Brad King
526c6ff6d2 Emscripten: Drop -sMAIN_MODULE and -sSIDE_MODULE with emsdk toolchain file
Emscripten provides a combined toolchain file and platform module that
predates CMake upstream support.  It disables support for shared libs.
Fix commit 96d9b94a98 (Emscripten: Add platform modules, 2025-05-16) to
avoid linking with `-sMAIN_MODULE` or `-sSIDE_MODULE` flags, meant to
support shared libraries, when using the emsdk toolchain file.

Fixes: #27232
2025-09-17 19:53:22 -04:00
Brad King
644ad91e6a Emscripten: Restore support for emsdk toolchain file and platform module
Emscripten provides a combined toolchain file and platform module that
predates CMake upstream support.  Since commit 96d9b94a98 (Emscripten:
Add platform modules, 2025-05-16), our `Platform/Emscripten` module is
included instead, suppressing existing behavior for users that set
`CMAKE_TOOLCHAIN_FILE` to the emsdk-provided toolchain file.  Restore
the previous behavior by teaching our module to defer to the original
module in that case.

Issue: #27232
2025-09-17 19:45:44 -04:00
Brad King
9cbeb922dd Emscripten: Enable de-duplication of libraries for CMP0156 with LLD
LLD automatically resolves newly encountered symbols using object files
previously encountered.  Also, the Emscripten compiler driver invokes
the LLD linker with `--whole-archive ... --no-whole-archive` around all
the libraries.  Therefore we should not repeat any.

Issue: #27232
Suggested-by: Marc Chevrier <marc.chevrier@gmail.com>
2025-09-17 19:44:13 -04:00
Brad King
f22d2904e2 Emscripten: Drop unused placeholder from link rule variables
Update commit 96d9b94a98 (Emscripten: Add platform modules, 2025-05-16)
to account for commit 67639002ad (Ninja,Makefile: Drop now-unused
placeholders from link rule variables, 2025-06-09, v4.1.0-rc1~37^2~1).
2025-09-17 19:44:13 -04:00
Brad King
f4da11a5da Emscripten: Select emcc and em++ compilers by default
This was missed by commit 96d9b94a98 (Emscripten: Add platform modules,
2025-05-16).
2025-09-17 19:44:13 -04:00
Brad King
28bab611c6 Tests: Add RunCMake.Emscripten case for a shared library 2025-09-17 19:43:36 -04:00
Brad King
d3e9c7bf8a Tests: Clarify RunCMake.Emscripten case names 2025-09-17 19:41:16 -04:00
Ben Boeckel
b2ebfd7709 shortobj: properly force long names when computing long names
The arguments need to be able to force a long name computation so that
install paths can use the intended long paths. Use this computed state
rather than asking the generator for its base state.

Also force long paths for Visual Studio generators when computing it.

Fixes: #27233
2025-09-17 14:36:29 -04:00
Ben Boeckel
1980e47192 Tests/IntermediateDirStrategy: test install paths when using SHORT
See: #27233
2025-09-17 14:23:15 -04:00
Eduard Voronkin
99839d1158 FASTBuild: expose more options
Expose more options for compiler configuration as well as adding unit test
2025-09-17 10:49:27 -07:00
Eduard Voronkin
9441f6cfb2 FASTBuild: improve IDE project structure
Right now, all IDE projects are located at the top level which makes it pretty messy  when there are a lot of them.

With this change the generated IDE project will more closely mimic existing folder structure in the project.
2025-09-17 10:03:26 -07:00
Vito Gamberini
058e7da541 Tutorial: Add redirect pages for removed steps 2025-09-17 11:57:34 -04:00
Vito Gamberini
b2e3e3e30e Tutorial: Rewrite using conventions enabled by CMake 3.23
This is a full re-write of the CMake Tutorial for CMake 3.23, both
the functionality it provides, as well as the modern workflows that
developers use when interfacing with CMake.

Issue: #22663, #23086, #23799, #26053, #26105, #26153, #26914
2025-09-17 11:57:23 -04:00
Brad King
9266d4817d Android: Allow custom compilers with NDK
If the user or toolchain file has already set `CMAKE_{C,CXX}_COMPILER`,
do not override it with the NDK-provided toolchain.

Fixes: #27162
2025-09-17 10:44:47 -04:00
Joerg Bornemann
763aa084b0 CMP0200: Fix crash in configuration selection policy warning
The recently introduced CMP0200 warnings could lead to a crash when
encountering targets with empty configuration values. Avoid calling
substr on an empty `string_view`.

Fixes: #27204
2025-09-17 10:30:12 -04:00
Brad King
a3ccb05430 Merge topic 'vs-ifx'
eae0a053f5 VS: Default Intel Fortran projects to ifx in VS 18 and above

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11197
2025-09-17 10:11:38 -04:00
Brad King
508cabc812 Merge topic 'cps-import-interface'
e23f0748d8 CPS: Import per-configuration attributes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11140
2025-09-17 10:09:06 -04:00
Brad King
1b77de4c1b Merge topic 'instrumentation-postbuild-error'
e5db41147a Tests/instrumentation: Improve error message when postBuild check fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11195
2025-09-17 10:07:21 -04:00
Brad King
b62e751369 Merge topic 'patch-FindGit-version'
fe72a5dba2 FindGit: Add Git_VERSION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11191
2025-09-17 10:04:31 -04:00
Brad King
6a77c80834 cmGlobalVisualStudioGenerator: Consolidate solution generation methods 2025-09-17 09:40:23 -04:00
Brad King
6b1c101410 cmGlobalVisualStudioGenerator: Adopt more solution generation methods 2025-09-17 09:40:22 -04:00
Brad King
772cf917c1 cmGlobalVisualStudio71Generator: Remove this now-unnecessary class
It no longer contains anything not in `cmGlobalVisualStudio7Generator`.
2025-09-17 09:40:22 -04:00
Brad King
3882718872 VS: Decouple solution generation from .sln file format
Rewrite `.sln` generation using a structured intermediate representation.

Issue: #25887
2025-09-17 09:40:07 -04:00
Kitware Robot
5536171cf3 CMake Nightly Date Stamp 2025-09-17 00:05:18 -04:00
Peter Kokot
6a0cf35429 FindQt3, FindQt4: Clarify QT_FOUND result variable
Both of these modules provide `QT_FOUND` variable when using the
deprecated FindQt module, but `<PackageName>_FOUND` should be used when
using `find_package(Qt3)` or `find_package(Qt4)`.

- Qt3_FOUND became available in CMake 3.3.
2025-09-16 23:10:44 +02:00
Brad King
eae0a053f5 VS: Default Intel Fortran projects to ifx in VS 18 and above
Intel oneAPI distributions no longer include the `ifort` compiler, but
its Visual Studio Integration defaults to `ifort` if `ifx` is not
explicitly specified in the `.vfproj` file.  We cannot change the
default Fortran compiler in VS 17 and older, but since the VS 18
generator is new, we can establish `ifx` as its default.  This
establishes working defaults on new versions of VS and oneAPI while
retaining existing behavior on older versions.

Issue: #26415
2025-09-16 14:35:33 -04:00
Eduard Voronkin
914a9eea94 FASTBuild: optimize generated file size
Two optimizations here:
1. Remove non-mandatory aliases (I only used them for debugging).
2. Make objects lists' name shorter

Both of those improvements contribute to the decrease of the FASTBuild DB file, since they are getting serialized.
2025-09-16 09:33:54 -07:00
Brad King
d67e7d2726 VS: Factor out Visual Studio Version enumeration 2025-09-16 11:33:35 -04:00
Brad King
76266f9df6 cmGlobalVisualStudioGenerator: Adopt some solution generation methods
All versions of VS we still support use the Solution model.
2025-09-16 11:33:13 -04:00
Brad King
d52eb1d083 cmGlobalVisualStudioGenerator: Remove unused folder support rules
Folders are supported on all versions of VS for which we still have
generators.
2025-09-16 11:32:51 -04:00
Brad King
50f87b4bf2 cmGlobalGenerator: Simplify collection of targets under a project() 2025-09-16 11:32:27 -04:00
Taylor Sasser
e23f0748d8 CPS: Import per-configuration attributes 2025-09-16 10:39:24 -04:00
Brad King
5e206e15c5 Merge topic 'fbuild_reduce_aliases'
4387c965a6 FASTBuild: optimize generated file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11193
2025-09-16 09:56:55 -04:00
Brad King
690ed2f706 Merge topic 'patch-CMakeConfigurableFile'
92c808687d Modules: Use file(CONFIGURE) instead of CMakeConfigurableFile.in

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11188
2025-09-16 09:55:23 -04:00
Brad King
4ae24357ad Merge topic 'patch-CMakeDependentOption-script-mode'
8b25e11fed CMakeDependentOption: Document project and script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11192
2025-09-16 09:53:39 -04:00
Brad King
ae0f7f8498 Merge topic 'findwxwidgets'
96f6382357 FindwxWidgets: updates for wxWidgets 3.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vadim Zeitlin <vz-kitware@zeitlins.org>
Merge-request: !11190
2025-09-16 09:51:52 -04:00