diff options
author | Sebastian Bauer <mail@sebastianbauer.info> | 2013-01-04 13:02:47 +0100 |
---|---|---|
committer | Sebastian Bauer <mail@sebastianbauer.info> | 2013-01-10 09:20:43 +0100 |
commit | b41e24a65c73c4ce052b02134ca559803400eecd (patch) | |
tree | da899057f1910f5f6f6f19435761227920eee8df /CMakeLists.txt | |
parent | 707ede86335850a97aa1ec5aad9539dfa2e87b9c (diff) | |
download | libgit2-b41e24a65c73c4ce052b02134ca559803400eecd.tar.gz |
Add -fPIC only if BUILD_SHARED_LIBS is ON
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dd4f0749..47533a282 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,7 +146,7 @@ ELSE () SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -Wall -Wextra -Wno-missing-field-initializers -Wstrict-aliasing=2 -Wstrict-prototypes ${CMAKE_C_FLAGS}") IF (MINGW) # MinGW always does PIC and complains if we tell it to STRING(REGEX REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}") - ELSE () + ELSEIF (BUILD_SHARED_LIBS) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fPIC") ENDIF () IF (APPLE) # Apple deprecated OpenSSL |