mold/0001-Use-system-compatible-...

45 lines
1.3 KiB
Diff
Raw Normal View History

2022-11-18 07:02:54 +00:00
From 73862d08e89da6b2c72eabbf3f61d612974e2ee0 Mon Sep 17 00:00:00 2001
Message-Id: <73862d08e89da6b2c72eabbf3f61d612974e2ee0.1668329176.git.github@sicherha.de>
2022-08-18 12:37:59 +00:00
From: Christoph Erhardt <github@sicherha.de>
2022-11-18 07:02:54 +00:00
Date: Sat, 6 Aug 2022 09:18:54 +0200
Subject: [PATCH] Use system-compatible include path for `xxhash.h`
2022-08-18 12:37:59 +00:00
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.
---
2022-09-29 14:55:45 +00:00
CMakeLists.txt | 2 ++
mold.h | 2 +-
2022-11-18 07:02:54 +00:00
2 files changed, 3 insertions(+), 1 deletion(-)
2022-08-18 12:37:59 +00:00
2022-09-29 14:55:45 +00:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
2022-11-18 07:02:54 +00:00
index 3c14940c..23e1d712 100644
2022-09-29 14:55:45 +00:00
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
2022-11-18 07:02:54 +00:00
@@ -191,6 +191,8 @@ else()
2022-09-29 14:55:45 +00:00
mold_add_tbb()
endif()
+target_include_directories(mold PRIVATE third-party/xxhash)
+
2022-11-18 07:02:54 +00:00
# We always use Clang to build mold on Windows. MSVC can't compile mold.
2022-09-29 14:55:45 +00:00
if(WIN32)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
2022-08-18 12:37:59 +00:00
diff --git a/mold.h b/mold.h
2022-11-18 07:02:54 +00:00
index 6f9fe2e8..5ebad268 100644
2022-08-18 12:37:59 +00:00
--- a/mold.h
+++ b/mold.h
@@ -32,7 +32,7 @@
#endif
#define XXH_INLINE_ALL 1
-#include "third-party/xxhash/xxhash.h"
+#include <xxhash.h>
2022-09-04 20:57:16 +00:00
#ifdef NDEBUG
# define unreachable() __builtin_unreachable()
2022-08-18 12:37:59 +00:00
--
2022-11-18 07:02:54 +00:00
2.38.1
2022-08-18 12:37:59 +00:00