Joel Rosdahl [Mon, 24 Jun 2024 18:55:33 +0000 (20:55 +0200)]
build: Bundle Fmt again
Fmt is currently the only required C++ dependency that isn't bundled.
Since the Fmt API is still evolving, it's convenient for Ccache users
that lack a proper Fmt version locally to be able to build without
having to download Fmt. Thus, bundle Fmt again for now. (When we can
bump compiler requirements to versions that implement std::format
properly in the future we will switch to std::format instead.)
Sam James [Sat, 8 Jun 2024 14:11:48 +0000 (15:11 +0100)]
build: Find CppHttplib named libhttplib.so as well (#1465)
On Gentoo, the library name is 'httplib', not 'cpp-httplib'. Search
for that first (as it appears to be "more vanilla"), then fall back
to 'cpp-httplib'.
Joel Rosdahl [Wed, 29 May 2024 18:54:31 +0000 (20:54 +0200)]
build: Fix zstd build for older CMake versions
With CMake 3.17.5 on CentOS7:
-- Downloading Zstd from the internet since Zstd>=1.3.4 was not found locally and DEPS=AUTO
CMake Error at cmake/FindZstd.cmake:60 (set_target_properties):
set_target_properties Can not find target to add properties to:
libzstd_static
Call Stack (most recent call first):
cmake/Dependencies.cmake:29 (find_package)
CMakeLists.txt:88 (include)
CMake Error at cmake/FindZstd.cmake:68 (add_library):
add_library cannot create ALIAS target "dep_zstd" because target
"libzstd_static" does not already exist.
Call Stack (most recent call first):
cmake/Dependencies.cmake:29 (find_package)
CMakeLists.txt:88 (include)
Silver Zachara [Tue, 28 May 2024 17:03:29 +0000 (19:03 +0200)]
build: Fix MSVC /Zc:preprocessor warning (#1461)
Don't add the /Zc:preprocessor- compiler flag when it's not needed, to
avoid the following warning:
D9025 : overriding '/Zc:preprocessor' with '/Zc:preprocessor-
The latest Windows SDK v10.0.22621 compiles fine with conforming
preprocessor enabled, the bug was in older SDK-s like <=10.0.20348.0.
Add the /Zc:preprocessor for msvc >=v19.25, it didn't exist before this
version (it existed as /experimental:preprocessor before).
Silver Zachara [Fri, 17 May 2024 19:12:25 +0000 (21:12 +0200)]
feat: Add --print-version option (#1454)
I have added a new `--print-version` option as ccache will support PCH
on msvc and I will need to somehow detect the ccache version to
correctly decide if PCH should be disabled
(`CMAKE_DISABLE_PRECOMPILE_HEADERS`).
So if ccache >=4.10 then don't disable PCH and if it's below then set
`CMAKE_DISABLE_PRECOMPILE_HEADERS=ON`.
Silver Zachara [Wed, 15 May 2024 18:44:21 +0000 (20:44 +0200)]
fix: Handle -Yc without filepath for msvc (#1448)
This PR further fixes the #1384. Fixes the case when the `/Yc` option is
without the filepath and the `/Fppathname` is also defined.
The `/Yc` can be passed in two ways with and w/o the filepath. When it's
passed w/o the filepath it must take the value of the `/Fp` option and
if the `/Fp` option isn't defined then the resulting .pch file must have
the same base name as the base source file with appended `.pch`
extension (this case isn't handled correctly by ccache).
The `/Yc` option doesn't support passing a filepath with the space
between like `/Yc filepath`. Because of this the `TAKES_ARG` must be
removed. All occurrences of `compopt_takes_path()` can't be invoked for
I have also added a new unittest for this case: "MSVC PCH options with
empty -Yc" and also tested it manually on my example project. Just now,
I have also tested it on a big project with 200 TU with qmake and cmake
build systems with msvc and also clang-cl with msvc compilers with 100%
cache hits (PCH enabled and /Zi replaced with /Z7).
Jiri Slaby [Sun, 12 May 2024 07:48:28 +0000 (09:48 +0200)]
feat: Add support for -fdump-ipa-clones (#1449)
Fixes #1447. Citing:
`-fdump-ipa-clones` is used heavily for live patching. Especially, when
one builds a distro kernel (like SLE 15 SP6), the build uses the option
to generate additional `.000i.ipa-clones` files.
Joel Rosdahl [Wed, 8 May 2024 18:45:13 +0000 (20:45 +0200)]
fix: Force run_second_cpp=true when generating profiling information
If run_second_cpp=false the coverage report will refer to the temporary
preprocessed file instead of the source file. Fix this by forcing
run_second_cpp=true if profiling information is being generated.