代码拉取完成,页面将自动刷新
From 2f95fc3b3c85a078c04fd65c2d16c96310f45daf Mon Sep 17 00:00:00 2001
Message-ID: <2f95fc3b3c85a078c04fd65c2d16c96310f45daf.1709318446.git.github@sicherha.de>
From: Christoph Erhardt <github@sicherha.de>
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 <xxhash.h>
#ifdef NDEBUG
# define unreachable() __builtin_unreachable()
--
2.44.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。