From 5e95a231748ffef48cb08768f25cbc1b35b568eb Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Sat, 23 Apr 2022 19:47:35 +0200 Subject: [PATCH] cmake: build static externals as PIC --- externals/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 7adf018f..57237ecb 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -1,5 +1,8 @@ # Always build externals as static libraries, even when dynarmic is built as shared -set(BUILD_SHARED_LIBS OFF) +if (BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS OFF) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +endif() # For libraries that already come with a CMakeLists file, # simply add the directory to that file as a subdirectory