Skip to content

Commit

Permalink
ensure -fPIC is used when building a static lib (#93)
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <[email protected]>
  • Loading branch information
dirk-thomas authored Aug 12, 2020
1 parent 9c31b67 commit 5e98497
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# enables building a static library but later link it into a dynamic library
add_compile_options(-fPIC)
endif()
if(NOT WIN32)
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
Expand Down

0 comments on commit 5e98497

Please sign in to comment.