From b41e24a65c73c4ce052b02134ca559803400eecd Mon Sep 17 00:00:00 2001 From: Sebastian Bauer Date: Fri, 4 Jan 2013 13:02:47 +0100 Subject: Add -fPIC only if BUILD_SHARED_LIBS is ON --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') 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 -- cgit v1.2.1