diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt index 3f220f7b..b758500f 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 container.h format.h format.cc ostream.h ostream.cc printf.h @@ -24,6 +26,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 $ $)