enable -fPIC on C, CXX and Pascal targets
authorkoda
Tue, 16 Jul 2013 11:14:03 +0200
changeset 9353 3694d354289e
parent 9351 09115096c7d6
child 9357 a501f5ec7b34
enable -fPIC on C, CXX and Pascal targets
CMakeLists.txt
--- a/CMakeLists.txt	Fri Jul 12 08:21:25 2013 +0200
+++ b/CMakeLists.txt	Tue Jul 16 11:14:03 2013 +0200
@@ -72,13 +72,13 @@
 include(${CMAKE_MODULE_PATH}/compilerchecks.cmake)
 
 #set default compiler flags
-add_flag_append(CMAKE_C_FLAGS "-Wall -pipe")
+add_flag_append(CMAKE_C_FLAGS "-Wall -pipe -fPIC")
 add_flag_append(CMAKE_C_FLAGS_RELEASE "-Os")
 add_flag_append(CMAKE_C_FLAGS_DEBUG "-Wextra -O0")
-add_flag_append(CMAKE_CXX_FLAGS "-Wall -pipe")
+add_flag_append(CMAKE_CXX_FLAGS "-Wall -pipe -fPIC")
 add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-Os")
 add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-Wextra -O0")
-add_flag_append(CMAKE_Pascal_FLAGS "-Cs2000000")
+add_flag_append(CMAKE_Pascal_FLAGS "-Cs2000000 -fPIC")
 add_flag_append(CMAKE_Pascal_FLAGS_DEBUG "-O- -gv")
 add_flag_append(CMAKE_Pascal_FLAGS_RELEASE "-Os -Xs")