From 6dfef3137428fe46f94d3178120345f0ccfb2c87 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 20 May 2020 04:01:41 +0100 Subject: fix(3p/abseil): Create position independent code This makes it possible to link Abseil into shared libraries, e.g. the various Nix libraries. --- third_party/abseil_cpp/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit 1.4.1