| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Since -flto=thin is not supported officially in FujitsuClang,
change to -flto.
|
|
|
|
|
| |
Added in LLVM commit a8f75d497daa2684a03909d7c31d5bce11b427e1, will be released
in 13.0.
|
|
|
|
| |
Fixes: #21772
|
|\
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Clang 12 landed initial support for C++23 language mode flag -std={c|gnu}++2b
in commit 6627a3c2873fdf7ccba1a1573371079be48b36e8.
|
|/
|
|
|
|
| |
CMake has no features for C++ versions past 14 and it seems unlikely we'd want
to add any.
Remove the related code.
|
|
|
|
| |
Fixes #17808
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
8c8f03422e PCH: Template instantiation support
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5168
|
| |
| |
| |
| |
| |
| |
| |
| | |
Adds PCH_INSTANTIATE_TEMPLATES target property for enabling template
instantiation in precompiled headers.
Enabled by default. Currently only supported for Clang 11 and newer.
Implements #21133.
|
|/
|
|
| |
Fixes: #21163
|
|
|
|
|
|
|
|
| |
Refactoring in commit 25439c7d62 (Clang: Refactor CXX standard flags
into __compiler_clang_cxx_standards(), 2020-03-16, v3.18.0-rc1~362^2~4)
accidentally broke the `cxx_std_*` fallback feature names.
Issue: #21033
|
| |
|
|
|
|
|
| |
-std=c++20 superseded -std=c++2a in upstream Clang commit
24ad121582454e625bdad125c90d9ac0dae948c8.
|
|
|
|
|
|
|
| |
These standard flags are the same for CXX, OBJCXX and CUDA.
Refactor them into a single macro to reduce duplication and so we can easily reuse them.
Updated bootstrap script to search in the general Clang module instead of the language-specific.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Fixes: #20039
|
|
|
|
| |
Fixes: #19786
|
|
|
|
| |
Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
|
|
|
|
| |
Fixes: #18700
|
|
|
|
| |
Fixes: #14983, #16561
|
|
|
|
|
|
|
| |
Respect the compiler target value `CMAKE_<LANG>_COMPILER_TARGET` in
`CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND`.
Issue: #18425
|
| |
|
|
|
|
|
|
| |
In `CMakeFortranCompilerId.F.in`, take the `_MSC_VER` out of the
Intel-specific block so it will trigger for other compilers like Flang.
In `Compiler/Clang.cmake`, switch off Fortran too.
|
|
|
|
|
|
|
|
| |
In the normal archiving rules the ``<CMAKE_AR>`` placeholder is replaced
by the generators with a properly-quoted path to the tool. In the IPO
rules we specify the tools directly, so we need to quote them.
Fixes: #17326
|
|
|
|
|
|
|
|
|
| |
We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and
Fortran languages. Do not try to enable support for other languages.
Furthermore, each language builds with a different compiler, so check
for support by CMake and the compiler for each language independently.
Fixes: #16944
|
| |
|
| |
|
|
|
|
|
| |
Honor the `INTERPROCEDURAL_OPTIMIZATION` target property for GNU
compilers by activating their link-time-optimization (LTO) flags.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool. Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience. Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.
Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices. It also references version control
history for more precise information. Therefore we no longer need to spell
out the list of Contributors in each source file notice.
Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing". The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.
Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically. Manually fix up shebang lines and trailing
newlines in a few files. Manually update the notices in a few files that the
script does not handle.
|
|
|
|
|
| |
When testing CMAKE_<LANG>_COMPILER_ID values against "MSVC", do not
allow the definition of the "MSVC" variable to be expanded.
|
|
|
|
|
|
|
|
|
|
| |
In Clang 3.4, the preferred (and new) option pattern is --target=.
http://thread.gmane.org/gmane.comp.compilers.clang.devel/29975
http://llvm.org/viewvc/llvm-project?view=revision&revision=184408
Clang 3.4 is not yet released, but there is a release candidate, and
there is a dashboard test of Clang trunk.
|
|
|
|
|
|
|
|
|
| |
Clang can compile code, but uses the gcc tools for other tasks such
as linking. The -gcc-toolchain option can be used for that, but
generalize so that other compilers can be treated the same.
If such a location is specified, use it as a hint for finding
the binutils executables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For clang, this allows passing -target <triple> to the compiler, and
for qcc, -V<arch> using toolchain files containing something like
set(triple arm-linux-gnueabihf)
set(CMAKE_C_COMPILER "/usr/bin/clang")
set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set(CMAKE_CXX_COMPILER_TARGET ${triple})
or
set(arch gcc_ntoarmv7le)
set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC)
set(CMAKE_CXX_COMPILER_TARGET ${arch})
Both clang and qcc are inherently cross compiler( driver)s.
When cross-compiling with clang, use the CMAKE_${lang}_COMPILER_TARGET
as the _CMAKE_TOOLCHAIN_PREFIX to find the appropriate binutils.
When cross-compiling with QNX qcc, use the CMAKE_${lang}_COMPILER_TARGET
to set the appropriate _CMAKE_TOOLCHAIN_PREFIX.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Teach the compiler identification preprocessor tests to report when
Clang simulates MSVC, and what version. If not MSVC, assume GNU.
Teach compiler information modules Clang-(C|CXX) to recognize when Clang
simulates MSVC and skip loading the GNU information.
Teach the Windows-MSVC platform information to recognize when it is
loaded as the simulated compiler and use that version information
instead of the real compiler's (different) version scheme.
Add platform modules Windows-Clang-(C|CXX) and support module
Windows-Clang to load either Windows-MSVC or Windows-GNU and wrap
the corresponding information macros.
|
|
|
|
| |
This reverts commit 2d9ec1dadfdd10043a98d425abb25d0aef117699.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For clang, this allows passing -target <triple> to the compiler, and
for qcc, -V<arch> using toolchain files containing something like
set(triple arm-linux-gnueabihf)
set(CMAKE_C_COMPILER "/usr/bin/clang")
set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set(CMAKE_CXX_COMPILER_TARGET ${triple})
or
set(arch gcc_ntoarmv7le)
set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC)
set(CMAKE_CXX_COMPILER_TARGET ${arch})
Both clang and qcc are inherently cross compiler( driver)s.
|
|
|
|
|
|
| |
This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target
property is used as the operand to the -fvisibility= compile option
with GNU compilers and clang.
|
|
|
|
|
|
|
|
| |
In GNU.cmake, -isystem is not used if APPLE is set. However, Clang has
pretty much always supported -isystem, so we should always use it.
In the future, GNU.cmake should do a version check to see if -isystem is
supported.
|
|
|
|
|
|
| |
The GNU compiler information file tests for GNU >= 3.4 because earlier
versions do not have the flag. The version number test is not valid for
Clang compiler versions, but we know Clang supports the flag.
|
|
While Clang presents an almost identical interface to GNU there will be
some differences. Split the compiler information modules to allow
separate rules for Clang. Start by loading the GNU rules but leave a
place to add Clang-specific information.
|