Commit Graph

1102 Commits

Author SHA1 Message Date
Brad King
7dadc53cc3 Merge topic 'flang-j-as-moddir' into release-4.2
db6b82ae54 LLVMFlang-Fortran: Use -J instead of -module-dir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !11443
2025-11-25 11:13:05 -05:00
Tarun Prabhu
db6b82ae54 LLVMFlang-Fortran: Use -J instead of -module-dir
In flang, both -J and -module-dir support both joined and separate values. For
the -J option, these are of the form `-J<value>` and `-J <value>` respectively.
Once https://github.com/llvm/llvm-project/pull/168748 is committed, -module-dir
will only work with a separate value. Setting CMAKE_Fortran_MODDIR_FLAG to -J
ensures that both joined and separate styles will continue to work after that
change is made. As far as behavior is concerned, both -J and -module-dir are
aliases.
2025-11-24 14:25:21 -05:00
Dylan Ulis
765e420128 QCC: Remove "-Wp," prefix for qcc system include arguments
`-Wp` is not needed on modern QNX/QCC.
`-isystem` is supported directly since QNX 7.0

Fixes: #26912
2025-10-09 09:51:29 -04:00
Daniel Körner
3a34f7715e TIClang: Add flags for C17 standard
C17 is supported since version 1.3.
2025-10-07 11:11:52 -04:00
Ben Boeckel
2b85541e39 cxximportstd: support setting the import std metadata location
Some deployments may not be able to discover the metadata file reliably
(e.g., custom `clang` builds on macOS while using the SDK's stdlib or
distribution bugs). Allow users to force the location so that
compiler-driven detection doesn't have to bend over backwards for
unforeseen bugs.
2025-09-11 18:03:00 -04:00
Andreas Graf
7493bc6d4a GHS C/CXX compiler: add NDEBUG compile define for non-debug aka release builds
Fixes: #27203
2025-09-08 18:19:03 +02:00
Eduard Voronkin
01147454e7 FASTBuild: Add generator
Fixes: #15294
2025-08-26 14:29:01 -07:00
Brad King
2013b79a87 Merge topic 'qcc-8-cxx-lang-flag'
ea3280f15b Merge branch 'qcc-8-cxx-lang-flag-3.31' into qcc-8-cxx-lang-flag
166061629a QCC-CXX: use `-x c++` on 8+
dc7adb64f3 QCC-CXX: use `-x c++` on 8+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10992
2025-08-05 09:53:52 -04:00
Ben Boeckel
166061629a QCC-CXX: use -x c++ on 8+
The `-lang-c++` flag has been deprecated.
2025-08-01 20:51:22 -04:00
Ben Boeckel
dc7adb64f3 QCC-CXX: use -x c++ on 8+
The `-lang-c++` flag has been deprecated.
2025-08-01 20:51:03 -04:00
Michael Hirsch
0d758be222 MSVC: Enable C23 language support
Introduced support via `-std:clatest` in cl 19.39.
2025-07-22 13:50:44 -04:00
Yonggang Luo
9a720d96eb clang-cl: Add support for C23
Although there is no `cl -std:c23` flag, the underlying Clang compiler
does have a C23 mode we can activate by passing `-std=c23` through a
`clang-cl` wrapper flag.

Also port the fix from commit 30139913e9 (VS: Restore support for mixing
C++23 and C in one target with clang-cl, 2024-12-09, v3.31.3~10^2).

Fixes: #27038
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: Brad King <brad.king@kitware.com>
2025-07-01 11:20:56 -04:00
Brad King
feba34c68a Merge topic 'link-flags'
d592558b8b cmLocalGenerator: Drop no-op link flag placeholder infrastructure
67639002ad Ninja,Makefile: Drop now-unused placeholders from link rule variables
951e4d3f62 Ninja,Makefile: Move builtin linker flags to <LINK_FLAGS> placeholder
6b618c6079 cmLocalGenerator: Clarify MODULE link flags placeholder population
c52a654aa1 cmLocalGenerator: Improve formatting of rule placeholder variable list
37cf9941ed UseEcos: Add missing placeholder in rules to link executables
fa61be5bc4 Embarcadero,OpenWatcom: Clear unused flags for creating shared libraries
124e40947c CMakeCommonLanguageInclude: Do not unset MODULE library flags when empty
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10869
2025-06-11 10:28:07 -04:00
Brad King
67639002ad Ninja,Makefile: Drop now-unused placeholders from link rule variables
Previously we used separate placeholders for builtin linker flags:

* CMAKE_<LANG>_LINK_FLAGS for EXECUTABLEs
* CMAKE_SHARED_LIBRARY_CREATE_<LANG>_FLAGS for SHARED libraries
* CMAKE_SHARED_MODULE_CREATE_<LANG>_FLAGS for MODULE libraries

These are now always replaced by the empty string, so drop them
from our rule variables.
2025-06-10 14:43:15 -04:00
Brad King
fa61be5bc4 Embarcadero,OpenWatcom: Clear unused flags for creating shared libraries
Clear `CMAKE_SHARED_LIBRARY_CREATE_<LANG>_FLAGS` since no special
link flags are needed to create a DLL with these toolchains.
Our shared library creation rules do not reference the placeholder,
so this variable was never used.  However, we may soon teach the
generators to look it up directly.
2025-06-10 08:53:47 -04:00
Brad King
7b4c87edae ADSP: Do not pass executable link flags when creating a static library
This was done by mistake in commit d090159318 (ENH: add support for the
ADSP toolchains for Blackfin, Shark and TigerShark DSPs, patch from
Raphael Cotty, 2007-07-12, v2.6.0~1446), and preserved in the
generalization by commit e9eabb0dcd (ADSP: Configure compiler in
compiler module, 2022-03-24, v3.24.0-rc1~331^2~1).  Fix both places.
2025-06-09 16:08:33 -04:00
Brad King
0165b3fa62 CrayPrgEnv: Drop unused static library "link" flags variable
In commit c54a621b55 (Cray: New platform file for Cray Linux Environment
and PrgEnv, 2015-11-13, v3.5.0-rc1~216^2~1) we populated variable
`CMAKE_STATIC_LIBRARY_LINK_<LANG>_FLAGS`, but we never reference it, and
the generators do not use it.  Static libraries are archives, and are
not produced by a linker.
2025-06-09 15:53:04 -04:00
Brad King
2f177e61d5 GNU: Remove non-functional code in OBJCXX support
In commit 9e66397c28 (Languages: Add support for Objective-C++,
2019-09-13, v3.16.0-rc1~44^2~2) we set `CMAKE_OBCXX_LINK_FLAGS`.
It was a typo for `CMAKE_OBJCXX_LINK_FLAGS`, and so has not had
any effect.
2025-06-09 15:28:29 -04:00
Robert Maynard
ea6b29a367 NVHPC: Add support for 25.07 no-pie option 2025-06-09 14:36:07 -04:00
Robert Maynard
8ef90ffc52 NVHPC: Add support for COMPILE_OPTIONS_VISIBILITY 2025-06-05 15:12:45 -04:00
Hirofumi Nakamura
514135f563 Renesas: Add support for Renesas compilers
- CC-RX for RX architecture
- CC-RL for RL78 architecture
- CC-RH for RH850 architecture

Closes: #26880
2025-05-28 09:22:38 -04:00
Brad King
0883fac39a Merge topic 'clang-libstdcpp-3.31' into release-3.31
802f261d62 experimental/CXXModules: recycle the UUID
c88f3ea1e4 Clang/CXXImportStd: support `-stdlib=libstdc++`
ba5c9703b1 Experimental: recycle the `import std` UUID
9cad48c6cb gcc: support `import std`
acbada3df6 Tests/RunCMake: handle C++26 support where needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10778
2025-05-14 15:31:47 -04:00
Ben Boeckel
c88f3ea1e4 Clang/CXXImportStd: support -stdlib=libstdc++
Fedora 42 ships `clang` with `libstdc++` as the default. Detect and
support `import std;` in this configuration.
2025-05-14 20:15:26 +02:00
Ben Boeckel
9cad48c6cb gcc: support import std
(cherry picked from commit a980dab9b1 (gcc: support `import std`,
2024-11-21))
2025-05-14 20:14:44 +02:00
Ben Boeckel
28333c4516 Clang/CXXImportStd: support -stdlib=libstdc++
Fedora 42 ships `clang` with `libstdc++` as the default. Detect and
support `import std;` in this configuration.
2025-04-30 13:47:27 +02:00
Brad King
0bc051c180 Merge topic 'automoc-predefs'
ccef69bde4 AUTOMOC: Avoid compiler warnings while computing predefines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10702
2025-04-24 07:45:21 -04:00
Brad King
ccef69bde4 AUTOMOC: Avoid compiler warnings while computing predefines
LLVM/Clang 20, when invoked as `clang++ -E -c ...`, now warns:

    warning: argument unused during compilation: '-c'

Drop the unnecessary `-c` flag.  Also add a `-w` flag to suppress
warnings so their text is not parsed as predefines.
2025-04-24 07:07:00 -04:00
Brad King
19e6184a7a Merge topic 'clang-msvc-c++26'
338f88a809 Clang: MSVC C++26 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10685
2025-04-22 09:17:13 -04:00
Raul Tambre
338f88a809 Clang: MSVC C++26 support
C++26 is implied by `/std:c++latest` since LLVM 17, commit `b763d6a4ed`.
2025-04-21 12:22:29 -04:00
Evan Wilde
dfa78c4868 Swift: Honor COMPILE_WARNING_AS_ERROR for command-line build systems
Define missing CMAKE_Swift_COMPILE_OPTIONS_WARNING_AS_ERROR for Swift to
`-warnings-as-errors`.

Fixes: #26872
2025-04-18 09:26:45 -04:00
Brad King
b805f55325 HIP: Fix default flags for Debug configuration
Pass `-g` to enable debugging, not `-O` for optimizations.  This was
probably a typo in commit b50bfc8913 (HIP: Add language to CMake,
2020-08-28, v3.21.0-rc1~66^2~4).

Fixes: #26823
2025-04-01 10:52:57 -04:00
Brad King
46838bbe11 Merge topic 'msvc-c++23'
d54916d03a MSVC: Revert use of temporary -std:c++23preview flag for C++23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10470
2025-03-17 11:42:05 -04:00
Brad King
89f6be8264 Merge topic 'msvc-c++23' into release-4.0
d54916d03a MSVC: Revert use of temporary -std:c++23preview flag for C++23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10470
2025-03-17 11:42:03 -04:00
Brad King
d54916d03a MSVC: Revert use of temporary -std:c++23preview flag for C++23
Revert commit b3f1c60aff (MSVC: Use -std:c++23preview flag for C++23
when available, 2025-03-12), except for the VS flag table update.
MSVC documentation states that the flag will be removed in the future
when `-std:c++23` is added.  Therefore it is only suitable for manual
specification by end-users.

Issue: #26692
2025-03-14 09:55:18 -04:00
Brad King
3f29c9d457 Merge topic 'msvc-c++23'
b3f1c60aff MSVC: Use -std:c++23preview flag for C++23 when available
1b4a802413 MSVC: Split C++23 flag selection into dedicated block

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10462
2025-03-13 09:40:55 -04:00
Brad King
5cfb301524 Merge topic 'msvc-c++23' into release-4.0
b3f1c60aff MSVC: Use -std:c++23preview flag for C++23 when available
1b4a802413 MSVC: Split C++23 flag selection into dedicated block

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10462
2025-03-13 09:40:53 -04:00
Brad King
b3f1c60aff MSVC: Use -std:c++23preview flag for C++23 when available
This was added by VS 17.13.

Fixes: #26692
2025-03-12 14:50:32 -04:00
Brad King
1b4a802413 MSVC: Split C++23 flag selection into dedicated block 2025-03-12 14:50:31 -04:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Brad King
808ada63cb Merge topic 'diab-compiler-support'
8ce6689d8b Diab: Add WindRiver Systems's Diab C/C++ toolchain

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10276
2025-02-14 09:35:26 -05:00
Sanjiv Gupta
8ce6689d8b Diab: Add WindRiver Systems's Diab C/C++ toolchain
Teach CMake to recognize Diab versions 5.9.x.x and above.

Closes: #26666
2025-02-13 10:15:00 -05:00
Josef Angstenberger
83ce71dd38 Tasking: Enable WHOLE_ARCHIVE link feature
Issue: #26426
2025-02-06 10:55:31 -05:00
Josef Angstenberger
1241c7dbcf Tasking: Set response file flag
If not explicitly set to `-f `, the default `@` is used,
which is not supported by Tasking.

Issue: #26426
2025-02-06 10:55:31 -05:00
Josef Angstenberger
754210a3f6 Tasking: Set object extension to .o
The extension `.o` is used by the compiler itself,
and is the only one found in its documentation.

Issue: #26426
2025-02-06 10:55:31 -05:00
Marc Chevrier
0ba67171d9 Extend CMAKE_<LANG>_LINK_MODE support
* Add CMAKE_Swift_LINK_MODE
* Ensure correct definition for various clang usages on Windows
2025-01-26 14:45:21 +01:00
Brad King
1d4d4362d9 Merge topic 'remove-old-compatibility'
77f71ad4e2 Remove compatibility with CMake versions older than 3.5
fb1bd1d330 CMP0065: Remove support for OLD behavior
d9dd38cccf CMP0064: Remove support for OLD behavior
d88047c329 Remove compatibility with CMake versions older than 3.3
ac1a9cb160 CMP0063: Remove support for OLD behavior
36fffb673a CMP0062: Remove support for OLD behavior
789a7d73d4 CMP0061: Remove support for OLD behavior
3dc19e24cb CMP0060: Remove support for OLD behavior
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10210
2025-01-23 09:36:59 -05:00
Brad King
c283aafe62 CMP0057: Remove support for OLD behavior 2025-01-22 10:40:53 -05:00
Brad King
9a3ecf15ab Merge topic 'tasking-std-flags'
c0972d2c81 Tasking: Drop extensions from C and CXX standard level flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Josef Angstenberger <code@jtxa.de>
Merge-request: !10208
2025-01-22 09:26:21 -05:00
Alaa Mahran
c0972d2c81 Tasking: Drop extensions from C and CXX standard level flags
Tasking compiler extensions and language standard flags are not tied
together as they are with gcc/clang.  Since CMake does not model
granular abstractions for extensions, leave individual extension flags
to the project or user.

Fixes: #26591
2025-01-21 09:59:05 -05:00