aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoakim Soderberg <joakim.soderberg@gmail.com>2013-04-18 09:25:17 +0000
committerJoakim Soderberg <joakim.soderberg@gmail.com>2013-04-18 09:25:17 +0000
commit3000831365312f96c1b4bb6dd70a3f7de1028831 (patch)
tree744da862a35b90405da9a3a47483d06d01d28f65 /CMakeLists.txt
parent6b1cba94e33732ef9d98abd4efeb80e7b1216be6 (diff)
downloadjansson-3000831365312f96c1b4bb6dd70a3f7de1028831.zip
jansson-3000831365312f96c1b4bb6dd70a3f7de1028831.tar.gz
jansson-3000831365312f96c1b4bb6dd70a3f7de1028831.tar.bz2
Use -fPIC when possible.
So that we can link the library statically to shared libraries.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74902fe..3e9b9eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,10 @@ if (MSVC)
add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo" )
endif()
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_C_FLAGS "-fPIC")
+endif()
+
# Check for the int-type includes
check_include_files (sys/types.h HAVE_SYS_TYPES_H)
check_include_files (inttypes.h HAVE_INTTYPES_H)