From 2f95fc3b3c85a078c04fd65c2d16c96310f45daf Mon Sep 17 00:00:00 2001 Message-ID: <2f95fc3b3c85a078c04fd65c2d16c96310f45daf.1709318446.git.github@sicherha.de> From: Christoph Erhardt Date: Sat, 6 Aug 2022 09:18:54 +0200 Subject: [PATCH 1/2] Use system-compatible include path for `xxhash.h` Distributors that build mold against the system-provided xxHash package expect its header file `xxhash.h` in the top-level include directory, not in an `xxhash` subdirectory. Adjust the include path and the `#include` directive accordingly. --- CMakeLists.txt | 2 ++ lib/common.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6d00990..82f338f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,6 +212,8 @@ else() mold_add_tbb() endif() +target_include_directories(mold PRIVATE third-party/xxhash) + # We always use Clang to build mold on Windows. MSVC can't compile mold. if(WIN32) if(MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") diff --git a/lib/common.h b/lib/common.h index b7e002a6..5ddc9213 100644 --- a/lib/common.h +++ b/lib/common.h @@ -34,7 +34,7 @@ #endif #define XXH_INLINE_ALL 1 -#include "../third-party/xxhash/xxhash.h" +#include #ifdef NDEBUG # define unreachable() __builtin_unreachable() -- 2.44.0