summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* feat: Allow forcing download of zstd and hiredis againJoel Rosdahl2023-01-291-6/+4
| | | | | | | | | | | | | | | | Before it was possible to force downloading of the Zstandard library using "-D ZSTD_FROM_INTERNET=ON" and similar for Hiredis. That ability was lost in 2c742c2c7ca9, so if you for some reason want to not use a locally installed library you're out of luck. Improve this by letting ZSTD_FROM_INTERNET and HIREDIS_FROM_INTERNET be tristate variables: ON: Always download AUTO (default): Download if local installation not found OFF: Never download As mentioned in #1240.
* ci: Build macOS universal binary (#1240)Raihaan Shouhell2023-01-271-0/+3
|
* chore: Rename primary/secondary storage to local/remote storageJoel Rosdahl2022-09-271-1/+1
| | | | | | | | | | | | | | | | | There is a feature request to be able not to use a local cache at all, only a network cache. With such a feature, the names "primary storage" and "secondary storage" make less sense since ccache would be operating in "secondary only" mode, but then that storage would of course become the primary (and only). Let's rename "primary storage" to "local storage" and "secondary storage" to "remote storage" – operating in "remote only" mode then makes sense. One of the original motivations to call networked storage "secondary" is that the file storage can be used for local file systems as well, making such storage "not quite remote", but in practice I guess the file storage backend used primarily for network file systems.
* fix: Fix Clang/Windows build (#1132)Orgad Shaneh2022-08-181-5/+7
|
* feat: Move Windows config and cache to LOCALAPPDATA (#1124)Rafael Kitover2022-08-011-1/+2
|
* feat: Download dependencies from the Internet when unavailable (#1112)Rafael Kitover2022-07-191-10/+5
| | | | | | | | | | Change the behavior of ZSTD_FROM_INTERNET and HIREDIS_FROM_INTERNET to always be on and only come into affect when the package is not found on the system by normal means. Also use the cmake standard module FetchContent for the download/checksum/unpack logic. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
* feat: Generalize STATIC_LINK option + fixes (#1058)Rafael Kitover2022-06-071-4/+19
|
* Revert "build: Bump required compiler versions"Joel Rosdahl2022-05-231-2/+14
| | | | | | This reverts commit 077e2a6c279755f6521ab78f4a1a049ae6a93990. Not needed yet.
* build: Bump required compiler versionsJoel Rosdahl2022-05-231-14/+2
|
* build: Remove now superfluous cmake policy settingJoel Rosdahl2022-05-231-2/+0
| | | | CMP0091 defaults to NEW with cmake_minimum_required 3.15 and later.
* build: Require C++17 compiler and CMake 3.15Joel Rosdahl2022-05-231-9/+3
| | | | | | | | A C++17-compatible compiler is now readily available on all systems we target primarily, so it's time to bump to C++17. Also, we want to use features in CMake 3.15 (see #1069), so bump that too.
* build: Enable static runtime linking for MSVC (#1069)Cristian Adam2022-05-231-4/+16
|
* fix: Add ASM and ASM_MASM to project() languages (#1043)Rafael Kitover2022-04-031-1/+1
|
* fix: Prefer CMake find module for hiredis packageJoel Rosdahl2022-03-261-1/+1
|
* fix: Prefer CMake find module for zstd package (#1030)Cristian Adam2022-03-261-1/+1
|
* feat: Remove automatic enabling of ccache for ccache buildJoel Rosdahl2022-02-071-1/+0
| | | | | | | | When enabling ccache using the standard recommended method (via PATH or via masquerading symlinks), UseCcache.cmake will introduce double invocations of ccache. I find this a bit annoying and I also think that it should be up to the user to enable or not enable ccache and which settings to use.
* feat(cmake): Disable IPO for mingwGregor Jasny2021-08-291-1/+1
| | | | | | On mingw IPO seems to be broken (out-of-diskspace errors and lacking linker module support), therefore IPO support is being deactivated.
* feat(cmake): Use standard linker for LTO scenariosGregor Jasny2021-08-291-5/+5
|
* build: Only probe for faster linker in dev build mode and on x86_64Joel Rosdahl2021-07-311-3/+1
| | | | | | | | | | | Using Gold or LLD on less common platforms such as MIPS may not be a good idea (see e.g. <https://www.sourceware.org/bugzilla/show_bug.cgi?id=22838>), so be conservative and only probe for a faster linker on platforms that likely don’t have toolchain bugs. Also, using a faster linker is in practice only relevant for dev builds. Fixes #907.
* build: Allow overriding CCACHE_DEV_MODE on command lineJoel Rosdahl2021-07-311-4/+6
|
* build: Remove “_lib” suffix from ccache_lib and third_party_libJoel Rosdahl2021-07-281-1/+1
| | | | | | | This means that libthird_party_lib.a will become libthird_party.a which removes repetition of “lib”. ccache_lib can’t be renamed to just ccache since that’s the name of the main binary, so that’s renamed to ccache_framework.
* Add support for downloading hiredis from InternetJoel Rosdahl2021-07-251-0/+3
|
* Add optional Redis secondary storage backend (#875)Anders Björklund2021-07-101-0/+5
|
* Remove system.hpp, including what’s needed insteadJoel Rosdahl2021-07-071-4/+0
| | | | This is the next step after a57f70eda32e99221de56f5499079b4f00dc2bc5.
* Require CMake 3.10 (#885)Gregor Jasny2021-07-061-11/+4
| | | Fixes #884.
* Fix CMake feature detection (#883)Gregor Jasny2021-07-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When enabling CMake policy <https://cmake.org/cmake/help/latest/policy/CMP0067.html> by either enabling it directly or via a `cmake_minimum_required` of `3.8` or later, the `test.inode_cache` test starts to fail. This happens because this policy slightly changes the `CheckCSourceCompiles` logic by passing-in any configured C-standard. The detection of the following features now report absence: --- CMakeCache-old.txt 2021-07-05 15:50:25.698278961 +0200 +++ CMakeCache-new.txt 2021-07-05 15:50:54.626397301 +0200 @@ -657,7 +657,7 @@ //Have function pthread_mutexattr_setpshared HAVE_PTHREAD_MUTEXATTR_SETPSHARED:INTERNAL=1 //Test HAVE_PTHREAD_MUTEX_ROBUST -HAVE_PTHREAD_MUTEX_ROBUST:INTERNAL=1 +HAVE_PTHREAD_MUTEX_ROBUST:INTERNAL= //Have include pwd.h HAVE_PWD_H:INTERNAL=1 //Have function realpath @@ -675,9 +675,9 @@ //Test HAVE_STRUCT_STATFS_F_FSTYPENAME HAVE_STRUCT_STATFS_F_FSTYPENAME:INTERNAL= //Test HAVE_STRUCT_STAT_ST_CTIM -HAVE_STRUCT_STAT_ST_CTIM:INTERNAL=1 +HAVE_STRUCT_STAT_ST_CTIM:INTERNAL= //Test HAVE_STRUCT_STAT_ST_MTIM -HAVE_STRUCT_STAT_ST_MTIM:INTERNAL=1 +HAVE_STRUCT_STAT_ST_MTIM:INTERNAL= //Have function syslog HAVE_SYSLOG:INTERNAL=1 //Have include syslog.h In case of `HAVE_PTHREAD_MUTEX_ROBUST` the now passed-in `-std=c99` does not enable the required `__USE_XOPEN2K` extension: #ifdef __USE_XOPEN2K /* Robust mutex or not flags. */ enum { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST }; #endif To remedy the situation CMake now checks for those features within a C++ language context. In C++ those features seem to be available without enabling any extra extensions. It also makes the check more precise because all of the consumers are C++ (and not C) compilation units.
* Require C++14-compatible compiler to build ccacheJoel Rosdahl2021-06-191-4/+6
| | | | | | | | | | Ccache 4.0 introduced a requirement on a C++11-compatible compiler. The language version was primarily chosen to support CentOS 7. The time has now come to bump to C++14, to among other things get access to generic lambda expressions and improved constexpr functions. Another side effect is to get usable support for std::regex due to requiring a newer GCC than 4.8 which lacks such support.
* Remove Ubuntu 16.04/Clang 3.8 buildJoel Rosdahl2021-06-191-6/+2
| | | | It no longer works.
* CMake: make build of documentation optional (#842)Petr Štetiar2021-05-031-1/+4
| | | | | | | | So we don't need to support corner cases as for example one fixed in commit f6202db308e3 ("doc/MANUAL.adoc: Don't use non-ASCII quotes (#761)") when the documentation is actually not needed at all as ccache is used as a build tool only. Signed-off-by: Petr Štetiar <ynezz@true.cz>
* Use Clang-Format executable from muttleyxd/clang-tools-static-binariesJoel Rosdahl2021-04-051-23/+13
| | | | | | | | | | | | | | misc/format-files now executes misc/clang-format, which works like this: 1. If environment variable CLANG_FORMAT is set, execute $CLANG_FORMAT. 2. Otherwise, if <ccache-top-dir>/misc/.clang-format-exe exists, execute that program. 3. Otherwise, download a statically linked clang-format executable, verify its integrity, place it in <ccache-top-dir>/misc/.clang-format-exe and execute it. This makes it possible for us to lock Clang-Format to version 10 and remove most “// clang-format off/on” comments.
* Probe for working faster linkerJoel Rosdahl2021-03-271-1/+3
| | | | | | | | As noted by Nicholas Hutchinson in #794, the availability of a linker program is not enough to conclude that it works for some older compilers and platforms like macOS and Windows. Improve this by probing if it works to pass “-fuse-ld=$LINKER”.
* Disable inode cache on OSes without pthread_mutexattr_setpshared() (#791)Stuart Henderson2021-01-251-1/+1
| | | | The inode cache requires pthread_mutexattr_setpshared() and build fails on OSes with sys/mman.h that do not have this function.
* Blake3 build (#781)Erik Flodin2021-01-191-1/+6
| | | | | | | | | | | | | | * Build the blake3 asm files to determine if they are supported Building the files doesn't take long and gives a better result than just checking that the assembler accepts a flag. See also #768. * Remove no longer used cmake function * Update BLAKE3 to 3a8204f5f (0.3.7 + minor fixes) and include all MSVC asm files * Try to improve blake3 on MSVC by using asm version
* Faster compile times (#759)Alexander Lanin2021-01-171-0/+2
|
* Reintroduce dev mode and disable problematic build flags in user modeJoel Rosdahl2020-12-061-0/+9
| | | | | | | | | | | | | | In version 3.x, ccache was in “user mode” when building from release archive sources and “dev mode” otherwise. In “dev mode”, additional compiler flags like “-Wextra -Wpedantic -Werror” were added, but they were not present in “user mode” in order not to break end users’ builds. This behavior was partially lost in the conversion to CMake. This commit tries to imitate the previous behavior by introducing a CCACHE_DEV_MODE CMake variable and only enable potentially problematic compiler flags when it’s set to ON. Related to #730.
* MinGW: Default to static linking (#732)Orgad Shaneh2020-11-291-1/+1
| | | | | | | The release contains only the executable without the dll dependencies. It is easier to deploy a single self-contained executable anyway. Fixes #729.
* MinGW: Fix static linkage with libgcc and libstdc++ and make it optional (#712)Orgad Shaneh2020-10-301-0/+4
| | | | There is no reason to enable it by default. Looks like it was done for enabling it to run with wine.
* Clean up CMakeLists.txtJoel Rosdahl2020-10-301-2/+2
|
* CI: List all configurations explicitly (#690)Alexander Lanin2020-10-261-0/+3
|
* Tweak formulations and fix spelling in CMakeLists.txtJoel Rosdahl2020-10-231-14/+18
|
* Detect errors in log strings at compile timeJoel Rosdahl2020-10-231-1/+3
| | | | | | | | | | | | | | | | | | | fmtlib can detect format string errors at compile time if (1) applying FMT_STRING to the format string literal and (2) compiling for C++14 or higher. Requirement 1 is implemented by introducing a LOG macro which applies FMT_STRING to the first argument and calls Logging::log (if logging is enabled). Also added are a companion LOG_RAW macro (since C++11 requires at least one argument for the “...” part in variadic macros) and a BULK_LOG macro which calls Logging::bulk_log (if logging is enabled). Requirement 2 is implemented by setting CMAKE_CXX_STANDARD to 14 for one CI build with a known C++14-capable compiler. We can’t set it to 14 by default since we still want the code to be buildable with C++11 compilers. This will catch errors such as the one fixed by PR #691.
* Fail gracefully on ancient compilers (#702)Alexander Lanin2020-10-231-0/+23
|
* Add option for enabling interprocedural (link time, LTO) optimizationJoel Rosdahl2020-10-071-0/+8
|
* Use STATUS instead of NOTICE for CMake messagesJoel Rosdahl2020-10-051-1/+1
| | | | NOTICE is apparently new for CMake 3.15.
* Support building on MSVC (#632)Rafael Kitover2020-08-271-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With these changes, the project builds with Visual Studio 2019, unit tests pass and it works correctly with mingw gcc. NOTE: The very latest version of Visual Studio 2019 is required, because there was just a necessary fix for template arguments. Tested building and running unit tests on Windows+MSVC, Windows+MinGW, Linux and macOS. - Enable `ZSTD_FROM_INTERNET` by default for MSVC when not using vcpkg or conan. - Add include tests for some standard UNIX headers not available on MSVC. - Add necessary MSVC compiler flags. - In `Args::from_gcc_atfile()` iterate over the string via `c_str()` instead of `cbegin()`, the MSVC string character iterator does not include the ending null byte. - Misc. minor cmake fix-ups. - Add some headers that are not implicitly included from other headers like `<algorithm>`, `<ios>`, `<cstdint>` and `<cstdarg>` in some places, gcc does this but MSVC does not. - Add `std::filesystem` version of `Util::traverse()` when dirent.h is not available, which is preferred for performance reasons. - Add implementations of the following functions that are not available in MSVC in Win32Util.cpp: `gettimeofday()`, `localtime_r()`, `asprintf()`. - Add Windows implementation of `getopt_long()` from https://www.codeproject.com/Articles/157001/Full-getopt-Port-for-Unicode-and-Multibyte-Microso to third_party/win32. - Add some compatibility typedefs, constants and macros to the `_WIN32` section of system.hpp, as well as the prototypes for the functions added to Win32Util.cpp. - Fix up unit tests expecting '/' separated paths to expect paths delimited by `DIR_DELIM_CH`. - Invoke test/run with bash from cmake, necessary on msys2+mingw64, many fail, there is more work to do here. - Set the warning level to `/W4` and silence all the uninteresting warning types. Compiles with no warnings now. - Switch to using standard C++ attributes `[[nodiscard]]` and `[[maybe_unused]]` and define macros for gcc for their equivalents. - `#define DOCTEST_CONFIG_USE_STD_HEADERS` for MSVC only, because it requires explicitly including `<ostream>`. - Add vim files to .gitignore. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
* Fix asm compiler detection (#644)Alexander Lanin2020-08-271-1/+1
| | | | CMake requires ASM to be the last parameter so it can try whether the C compiler can compile asm. See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1560/diffs
* Add CMake build type “CI” like “RelWithDebInfo” but without -DNDEBUGJoel Rosdahl2020-08-231-0/+1
|
* Rename CCachePackConfig.cmake to CcachePackConfig.cmakeJoel Rosdahl2020-08-221-1/+1
| | | | It’s Ccache, not CCache.
* Improve building via DockerJoel Rosdahl2020-08-061-1/+1
| | | | | | | | | | | | | | - Simplified names (e.g. ubuntu-14-trusty -> ubuntu-14.04, debian-9-stretch -> debian-9). - Enabled debian-9 in misc/test-all-systems since it works. - Renamed centos to centos-7. - Added centos-8 and fedora-32. - Updated dockerfiles/README to match reality after the conversion to CMake. - Cleaned up Dockerfiles. - Improved misc/test-all-systems. - Removed unsupported Clang build for alpine-3.4, centos-7 and ubuntu-14.04.
* Clean up scripts related to code formattingJoel Rosdahl2020-06-231-2/+2
| | | | | - Simplified scripts. - Made colored output work again.