From 6be930f0cfca31d62c3dc498b3fc9e756acca710 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 22 May 2007 09:15:00 -0400 Subject: [PATCH] STYLE: move the two CMAKE_SHARED_LIBRARYC/CXX_FLAGS for gcc from CMakeGenericSystem.cmake to gcc.cmake Alex --- Modules/CMakeGenericSystem.cmake | 22 ++++++++-------------- Modules/Platform/gcc.cmake | 3 ++- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index 47c84fc96..897969ab2 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -1,11 +1,3 @@ -SET(CMAKE_LINK_LIBRARY_SUFFIX "") - -SET(CMAKE_STATIC_LIBRARY_PREFIX "lib") -SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a") -SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib -SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so -SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe -SET(CMAKE_DL_LIBS "dl") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib @@ -15,12 +7,14 @@ SET(CMAKE_INCLUDE_FLAG_C "-I") # -I SET(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty SET(CMAKE_LIBRARY_PATH_FLAG "-L") SET(CMAKE_LINK_LIBRARY_FLAG "-l") -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic -ENDIF(CMAKE_COMPILER_IS_GNUCC) -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic -ENDIF(CMAKE_COMPILER_IS_GNUCXX) + +SET(CMAKE_LINK_LIBRARY_SUFFIX "") +SET(CMAKE_STATIC_LIBRARY_PREFIX "lib") +SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a") +SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib +SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so +SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe +SET(CMAKE_DL_LIBS "dl") SET(CMAKE_FIND_LIBRARY_PREFIXES "lib") SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a") diff --git a/Modules/Platform/gcc.cmake b/Modules/Platform/gcc.cmake index 6493c6281..695a55f8d 100644 --- a/Modules/Platform/gcc.cmake +++ b/Modules/Platform/gcc.cmake @@ -1,4 +1,5 @@ IF(CMAKE_COMPILER_IS_GNUCC) + SET (CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic SET (CMAKE_C_FLAGS_INIT "") SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") @@ -12,6 +13,7 @@ IF(CMAKE_COMPILER_IS_GNUCC) ENDIF(CMAKE_COMPILER_IS_GNUCC) IF(CMAKE_COMPILER_IS_GNUCXX) + SET (CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic SET (CMAKE_CXX_FLAGS_INIT "") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") @@ -23,4 +25,3 @@ IF(CMAKE_COMPILER_IS_GNUCXX) SET (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") ENDIF(NOT APPLE) ENDIF(CMAKE_COMPILER_IS_GNUCXX) -