]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix location of secondary configuration
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 18 Jun 2020 16:58:20 +0000 (18:58 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 18 Jun 2020 19:12:46 +0000 (21:12 +0200)
Regression in #573 (f2341b2b).

CMakeLists.txt
cmake/config.h.in
src/ccache.cpp

index 51a1aa3c9a1394077e846bd82546c9bbf9fc7558..09946819bca5265e9de79f8965764ea0b7d86212 100644 (file)
@@ -26,6 +26,7 @@ include(DefaultBuildType)
 #
 # Configuration
 #
+include(GNUInstallDirs)
 include(GenerateConfigurationFile)
 include(GenerateVersionFile)
 
@@ -63,7 +64,6 @@ add_subdirectory(doc)
 #
 # Installation
 #
-include(GNUInstallDirs)
 install(TARGETS ccache DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 #
index 51e897a5ce6d10d8bea77c0bdb22d33b99b59254..c2e76b94e9aae2278102f0d49c83d77ad6f6b133 100644 (file)
@@ -46,6 +46,8 @@
 #cmakedefine _WIN32_WINNT @_WIN32_WINNT@
 // clang-format on
 
+#define SYSCONFDIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@"
+
 #ifdef __clang__
 #  pragma clang diagnostic pop
 #endif
index 2b74f0e2b91b78ba2d319d0880bf69c6e8a83ad7..7d4f9aaec59b16a65a2b1dce97891e262b0e463e 100644 (file)
@@ -56,9 +56,6 @@
 
 #include <limits>
 
-#define STRINGIFY(x) #x
-#define TO_STRING(x) STRINGIFY(x)
-
 using nonstd::nullopt;
 using nonstd::optional;
 using nonstd::string_view;
@@ -1859,8 +1856,7 @@ set_up_config(Config& config)
   if (p) {
     config.set_primary_config_path(p);
   } else {
-    config.set_secondary_config_path(
-      fmt::format("{}/ccache.conf", TO_STRING(SYSCONFDIR)));
+    config.set_secondary_config_path(fmt::format("{}/ccache.conf", SYSCONFDIR));
     MTR_BEGIN("config", "conf_read_secondary");
     // A missing config file in SYSCONFDIR is OK so don't check return value.
     config.update_from_file(config.secondary_config_path());