| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
In commit 88c740462c (CUDA/Clang: Add support for MSVC ABI on Windows
using GNU-like frontend, 2024-01-17) we updated the message for the
existing check to mention CUDA, but neglected to update the check
itself.
Issue: #25648
|
|
|
|
| |
Fixes: #20776
|
|
|
|
|
|
|
|
|
| |
Some platforms, Apple or Windows for instance, do not require to duplicate
static libraries to resolve mutual dependencies. Moreover, Xcode version 15
emits a warning if a library is duplicated.
On Windows, enable a better control of libraries order.
Fixes: #20722, #25297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extract the effective linker during the computation of implicit artifacts
delivered by the compiler to the linker.
Define various variables describing the linker:
* CMAKE_<LANG>_COMPILER_LINKER
* CMAKE_<LANG>_COMPILER_LINKER_VERSION
* CMAKE_<LANG>_COMPILER_LINKER_ID
* CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT
This is complementary to feature introduced by commit 96a953b1ed
(Add options to specify linker tool, 2023-09-27).
Fixes: #17596, #18209, #25344
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Offer the capability, through variable `CMAKE_LINKER_TYPE`, as well as
the target property `LINKER_TYPE` to specify which linker must be used.
The implementation of this capability is specified by variables specific
to the language and linker type: `CMAKE_<LANG>_USING_LINKER_<TYPE>`.
Some definitions are provided as part of `CMake`.
For example, to select the `LLVM` linker rather than the standard one,
the type `LLD` should be specified through the variable `CMAKE_LINKER_TYPE`.
And, on `Apple`, `Linux` and some environments on `Windows`, the variable
`CMAKE_<LANG>_USING_LINKER_LLD` has value `-fuse-ld=lld`. And for `Windows`
environments based on `MSVC`, where the linker is used directly, the tool
`lld-link.exe` will be used rather than `link.exe`.
Fixes: #19174, #24254, #24990
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a platform module for using clang for HIP on windows, based on the
CXX module.
HIP language on windows works without this, but mixing with MSVC
produces catastrofical results.
Add the same restriction with HIP as C and C++ had prior:
Either none are compiled with MSVC or all are.
clang-cl support for HIP does not work yet: it needs more work in both
hip-lang-config.cmake and cmake itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace our hard-coded default for `/Zi` with a first-class abstraction
to select the debug information format an enumeration of logical
names. We've long hesitated to do this because the idea of "debug
information format" 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 flag 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 CMP0141 to
provide compatibility.
Fixes: #10189
|
|
|
|
| |
Also avoid extra spaces in resulting flag strings.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since commit bb61c2d024 (Clang: use -imsvc for system include dirs when
running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we use the `-imsvc`
flag followed by the include directory as a separate argument. Some
versions of `clang-tidy` do not support the flag unless the include
directory is attached to it, so use that form instead.
A similar fix was made by commit 3a8b6653dc (MSVC: Use -external:I flag
without space to support Clang tools, 2022-01-11, v3.22.2~8^2).
Fixes: #23517
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add `COMPILE_WARNING_AS_ERROR` target property and supporting
`CMAKE_COMPILE_WARNING_AS_ERROR` variable.
`COMPILE_WARNING_AS_ERROR` is initialized by
`CMAKE_COMPILE_WARNING_AS_ERROR`. It is a boolean variable. If it is
true, it expands to a different flag depending on the compiler such that
any warnings at compile will be treated as errors.
Supports compiler ids that I could find a relevant flag for.
|
|/ |
|
| |
|
|
|
|
| |
Fixes #22905.
|
|
|
|
| |
Solves: #22611
|
|
|
|
|
|
|
|
|
| |
Update the archive rules added by commit 6e3655db2c (Clang: add LTO
support for GNU-command line clang on windows, 2019-07-08,
v3.16.0-rc1~161^2~3) to match the `ar` convention we use for normal
archives.
Issue: #21988
|
|
|
|
|
|
|
|
| |
Allows using different compilers with different flags for different languages.
For example Clang with GNU-like commandline for CXX and MSVC as host compiler
for CUDA.
Should help with #21914.
|
|\
| |
| |
| |
| |
| |
| |
| | |
2fc5e5dba9 Clang: Use -imsvc for system include only with MSVC-like front-end
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Thomas Bernard <thomas@famillebernardgouriou.fr>
Merge-request: !5792
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In commit bb61c2d024 (Clang: use -imsvc for system include dirs when
running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we added `-imsvc`
for all Clang compilers targeting the MSVC ABI. However, the option
only exists for the MSVC-like front-end. The GNU-like front-ends
use `-isystem`.
Fixes: #21789
|
| |
| |
| |
| | |
Fixes #21613.
|
|\ \
| |/
|/| |
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
9ac9876757 Clang on Windows: 'LINKER:' prefix must be honored
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5551
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These changes are in preparation of compiler generated dependencies support
for Makefiles generators
* compiler output and dependency target can be different for Makefiles generators
* resolve inconsistency naming for dependency file place-holder
|
| | |
| | |
| | |
| | | |
Fixes: #21315
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
When preprocessing the rc file using the clang gnu front end we need to
force the source file type to a c file for the preprocessing to take
place.
Fixes: #21472
|
|/
|
|
| |
Fixes: #21094
|
|
|
|
| |
Fixes: #21097
|
|\
| |
| |
| |
| |
| |
| | |
8d61294c3e PCH: Mark CMake PCH source files as -x <lang>-header
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5188
|
| |
| |
| |
| | |
Fixes: #21163
|
| |
| |
| |
| | |
Fixes: #21096
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
When the installation path to cmake includes spaces, the
`<CMAKE_COMMAND>` is required to have proper quotation of the cmake
call.
Fixes: #21095
|
| |
| |
| |
| |
| |
| |
| | |
On Linux and macOS, absolute paths start with `/` which may be
interpreted by clang-cl as an option. To avoid this, we separate the
source file path from preceding options with `--` to tell `clang-cl` it
is not an option.
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4570
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for
llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) with llvm-rc we explicitly
preprocess RC source files and then compile separately without -I flags.
This broke cases where the RC source references data files adjacent to
itself or in the include path.
This change adds the expansion of the include paths when calling the
llvm-rc in order for the resource files to be picked up correctly by
llvm-rc. Since the RC compiled file is first preprocessed, the file
being compiled by llvm-rc resides in the build directory. In order for
llvm-rc to find the resource data specified relative to the .rc file
being compiled, the source file path is preppended in the include list
so that the original source path takes priority over all the other
includes paths specified.
A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include
directive work properly for llvm-rc. Checks on the rc.exe showed that
the syntax change doesn't affect it's proper operation.
Fixes: #20529
|
|\ \
| |/
| |
| |
| |
| |
| | |
4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4535
|
| |
| |
| |
| |
| | |
`CMAKE_RC_COMPILER_INIT` and `CMAKE_RC_COMPILER` can be set by user,
for example `llvm-rc-10` and `D:\LLVM\bin\llvm-rc.exe`.
|
|\ \
| |/
| |
| |
| |
| |
| |
| | |
2c724c3aea llvm-rc: Write depfile to location specified by the generator
4cc876540e llvm-rc: Select preprocessor from active languages
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4524
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Move the depfile flags to `CMAKE_DEPFILE_FLAGS_RC` so that they
are only usedwith generators that use depfiles. Also switch to
using the `<DEPFILE>` placeholder for the location of the depfile
so that it goes where the generator expects.
Fixes: #20493
|
| |
| |
| |
| |
| |
| | |
The llvm-rc preprocessor is selected according to the
CMAKE_C_COMPILER_ID / CMAKE_CXX_COMPILER_ID which are only defined when
the C or CXX language is active.
|
|/ |
|
|
|
|
|
|
|
|
| |
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for
llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) we pass the full target `<FLAGS>`
to the llvm-rc resource compiler, but we should pass only `<DEFINES>`.
Fixes: #20414
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add an additional include flag to PCH usage command line to fix programs
that rely on `compile_commands.json` file. Pass it to the preprocessor
directly to avoid compiler driver to change it to '-include-pch'.
When preprocessor is requested to preprocess a file, it tries to get
the original filename from '.pch' and uses that file for preprocessing.
CMake generates a '.pch' file from the '.hxx' file by passing an empty
'.cxx' source file to the compiler as a compilation unit and the header
file with the '-include' flag. After that, compiler puts compilation
unit filename in the '.pch' as the original filename.
However, CMake build system uses empty file as the source file and
passes the header file using '-include-pch' flag. As a result, Clang
uses the wrong file for preprocessing and produces the corrupted
preprocessed file.
Fixes: #20355
Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
|
|
|
|
|
|
|
|
|
| |
llvm-rc requires preprocessed rc files. The CMake command line tool
cmake_llvm_rc enables channing the preprocessor call and the resource
compiler and make this appear as single compilation step.
When llvm-rc is detected as resource compiler, the RC compilation step
is set to use this command.
|
|
|
|
|
|
| |
This allows building .s/.S assembly code, and makes sure that the
`-fPIC` option isn't passed to the compiler (as it errors out on
Clang and causes a loud warning on GCC).
|
|
|
|
|
|
|
|
| |
Modern distributions of packages built with MinGW tools provide `.dll.a`
import libraries. Prefer those instead of finding plain `.dll` files.
This avoids accidentally finding unrelated Windows `.dll` files.
Fixes: #20019
|
| |
|
|
|
|
| |
Fixes: #19786
|