summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2022-08-18 20:15:37 +0300
committerGitHub <noreply@github.com>2022-08-18 19:15:37 +0200
commit58f623036f428710f8f58d9adfa40dade43445f4 (patch)
tree802372443c7bed0d5205a7b1ed30cd9b7ffc1a2e
parentc49d4788683b821c0df61c54944ca857f93bb83a (diff)
downloadccache-58f623036f428710f8f58d9adfa40dade43445f4.tar.gz
fix: Fix Clang/Windows build (#1132)
-rw-r--r--CMakeLists.txt12
-rw-r--r--src/util/LockFile.cpp2
2 files changed, 9 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c7b4583..30b18a51 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -99,11 +99,13 @@ if(STATIC_LINK)
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# Link MINGW runtime statically.
- elseif(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL GNU)
- list(APPEND CCACHE_EXTRA_LIBS -static-libgcc -static-libstdc++ -static -lwinpthread -dynamic)
- # Link WIN32 clang libs statically.
- elseif(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
- list(APPEND CCACHE_EXTRA_LIBS -Wl,-Bstatic -lc++ -lunwind -Wl,-Bdynamic)
+ elseif(WIN32)
+ if((CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (CMAKE_CXX_COMPILER_ID STREQUAL Clang))
+ list(APPEND CCACHE_EXTRA_LIBS -static-libgcc -static-libstdc++ -static -lwinpthread -dynamic)
+ endif()
+ if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+ list(APPEND CCACHE_EXTRA_LIBS -fuse-ld=lld)
+ endif()
endif()
endif()
diff --git a/src/util/LockFile.cpp b/src/util/LockFile.cpp
index 7dee3c9e..3a0bd797 100644
--- a/src/util/LockFile.cpp
+++ b/src/util/LockFile.cpp
@@ -43,10 +43,12 @@
// Seconds.
const double k_min_sleep_time = 0.010;
const double k_max_sleep_time = 0.050;
+#ifndef _WIN32
const double k_staleness_limit = 2;
const double k_keep_alive_interval = k_staleness_limit / 4;
const auto k_keep_alive_interval_ms = std::chrono::milliseconds{
static_cast<uint64_t>(k_keep_alive_interval * 1000)};
+#endif
namespace {