diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt index 9e491f93..12df0f34 100644 --- a/fmt/CMakeLists.txt +++ b/fmt/CMakeLists.txt @@ -1,3 +1,5 @@ +include(CheckCXXCompilerFlag) + # Define the fmt library, its includes and the needed defines. # *.cc are added to FMT_HEADERS for the header-only configuration. set(FMT_HEADERS format.h format.cc ostream.h ostream.cc printf.h printf.cc @@ -21,6 +23,11 @@ if (FMT_PEDANTIC) target_compile_options(fmt PRIVATE ${PEDANTIC_COMPILE_FLAGS}) endif () +check_cxx_compiler_flag(-fPIC FMT_HAS_FPIC_FLAG) +if (FMT_HAS_FPIC_FLAG) + target_compile_options(fmt PRIVATE -fPIC) +endif() + target_include_directories(fmt PUBLIC $ $)