From c1f4fbe964628fca8a590b7bb2b480485c93f4ce Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Sat, 4 Nov 2023 09:56:58 +0100 Subject: [PATCH] chore(build): build -fPIC for improved shared library support --- support/BuildSupport.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/BuildSupport.cmake b/support/BuildSupport.cmake index 6e9eed00..1cbac49a 100644 --- a/support/BuildSupport.cmake +++ b/support/BuildSupport.cmake @@ -54,7 +54,7 @@ endfunction() ## COMPILE(list): A list containing the compiler flags ## LINK(list): A list containing the linker flags function(bs_internal_select_cflags_gcc SANITIZERS COMPILE LINK) - list(APPEND _INTERNAL_FLAGS "-Wall" "-Wextra" "-Werror" "-Wconversion" "-Wshadow" "-Wpedantic") + list(APPEND _INTERNAL_FLAGS "-Wall" "-Wextra" "-Werror" "-Wconversion" "-Wshadow" "-Wpedantic" "-fPIC") if (CMAKE_BUILD_TYPE MATCHES "^Debug" AND ${SANITIZERS} AND NOT WIN32) list(APPEND _INTERNAL_FLAGS "-fsanitize=address" "-fsanitize=undefined" "-fsanitize=leak")