Use -fPIC when possible.

So that we can link the library statically to shared libraries.
This commit is contained in:
Joakim Soderberg 2013-04-18 09:25:17 +00:00
parent 6b1cba94e3
commit 3000831365

View File

@ -79,6 +79,10 @@ if (MSVC)
add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo" ) add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo" )
endif() endif()
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "-fPIC")
endif()
# Check for the int-type includes # Check for the int-type includes
check_include_files (sys/types.h HAVE_SYS_TYPES_H) check_include_files (sys/types.h HAVE_SYS_TYPES_H)
check_include_files (inttypes.h HAVE_INTTYPES_H) check_include_files (inttypes.h HAVE_INTTYPES_H)