about summary refs log tree commit diff
path: root/third_party
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-20T03·01+0100
committerVincent Ambo <tazjin@google.com>2020-05-20T03·01+0100
commit6dfef3137428fe46f94d3178120345f0ccfb2c87 (patch)
tree87f20b332f79ffc6b921c1f640d7f5b26a19717f /third_party
parente2fad0f0d208ff7d24214f010cca2d4a0be79d9e (diff)
fix(3p/abseil): Create position independent code r/785
This makes it possible to link Abseil into shared libraries, e.g. the
various Nix libraries.
Diffstat (limited to 'third_party')
-rw-r--r--third_party/abseil_cpp/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/third_party/abseil_cpp/CMakeLists.txt b/third_party/abseil_cpp/CMakeLists.txt
index 47670454ad9d..1ef35cfd224c 100644
--- a/third_party/abseil_cpp/CMakeLists.txt
+++ b/third_party/abseil_cpp/CMakeLists.txt
@@ -51,6 +51,9 @@ list(APPEND CMAKE_MODULE_PATH
   ${CMAKE_CURRENT_LIST_DIR}/absl/copts
 )
 
+# Linking Abseil to shared libraries (such as Nix) requires PIC.
+set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
 include(AbseilInstallDirs)
 include(CMakePackageConfigHelpers)
 include(AbseilDll)