cmake: compile PIC with "-fPIC"
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2021-11-20 22:27:44 +01:00
parent e531aa6289
commit d942e06263
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -95,6 +95,10 @@ add_subdirectory(lib/fmt EXCLUDE_FROM_ALL)
endif(NOT CMAKE_CXX_FLAGS MATCHES "-fasynchronous-unwind-tables")
endif(CMAKE_BUILD_TYPE MATCHES "Release")
if(NOT CMAKE_CXX_FLAGS MATCHES "-fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif(NOT CMAKE_CXX_FLAGS MATCHES "-fPIC")
# inspired by https://medium.com/@alasher/colored-c-compiler-output-with-ninja-clang-gcc-10bfe7f2b949
option (COLORS_FOREVER "Always produce ANSI-colored output (GNU/Clang only)." TRUE)
if (${COLORS_FOREVER})