cmake: properly separate ldflags from cflags

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3567 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2010-07-25 14:20:03 +00:00
parent 4e90b10c76
commit 83604ec59d
23 changed files with 114 additions and 4 deletions

View File

@ -60,3 +60,8 @@ set(SoundTouchHeaders
# add library # add library
add_library(${Output} STATIC ${SoundTouchSources} ${SoundTouchHeaders}) add_library(${Output} STATIC ${SoundTouchSources} ${SoundTouchHeaders})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -48,3 +48,8 @@ set(bzip2Headers
# add library # add library
add_library(${Output} STATIC ${bzip2Sources} ${bzip2Headers}) add_library(${Output} STATIC ${bzip2Sources} ${bzip2Headers})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -53,3 +53,8 @@ set(a52Headers
# add library # add library
add_library(${Output} STATIC ${a52Sources} ${a52Headers}) add_library(${Output} STATIC ${a52Sources} ${a52Headers})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -63,3 +63,8 @@ inftrees.h )
# add library # add library
add_library(${Output} STATIC ${zlibSources} ${zlibHeaders}) add_library(${Output} STATIC ${zlibSources} ${zlibHeaders})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -96,9 +96,9 @@ endif(CMAKE_BUILD_STRIP)
# By default allow build on amd64 machine # By default allow build on amd64 machine
if(DEFINED USER_CMAKE_C_FLAGS) if(DEFINED USER_CMAKE_C_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_C_FLAGS at your own risk !!!") message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_C_FLAGS at your own risk !!!")
string(STRIP "${USER_CMAKE_C_FLAGS} ${USER_CMAKE_LD_FLAGS} -m32" CMAKE_C_FLAGS) string(STRIP "${USER_CMAKE_C_FLAGS} -m32" CMAKE_C_FLAGS)
else(DEFINED USER_CMAKE_C_FLAGS) else(DEFINED USER_CMAKE_C_FLAGS)
string(STRIP "${USER_CMAKE_LD_FLAGS} -m32" CMAKE_C_FLAGS) string(STRIP "-m32" CMAKE_C_FLAGS)
endif(DEFINED USER_CMAKE_C_FLAGS) endif(DEFINED USER_CMAKE_C_FLAGS)
@ -108,10 +108,10 @@ endif(DEFINED USER_CMAKE_C_FLAGS)
if(DEFINED USER_CMAKE_CXX_FLAGS) if(DEFINED USER_CMAKE_CXX_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_CXX_FLAGS at your own risk !!!") message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_CXX_FLAGS at your own risk !!!")
string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS) string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
string(STRIP "${USER_CMAKE_CXX_FLAGS} ${USER_CMAKE_LD_FLAGS} -m32" CMAKE_CXX_FLAGS) string(STRIP "${USER_CMAKE_CXX_FLAGS} -m32" CMAKE_CXX_FLAGS)
else(DEFINED USER_CMAKE_CXX_FLAGS) else(DEFINED USER_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "") set(CMAKE_CXX_FLAGS "")
string(STRIP "${USER_CMAKE_LD_FLAGS} -m32" CMAKE_CXX_FLAGS) string(STRIP "-m32" CMAKE_CXX_FLAGS)
endif(DEFINED USER_CMAKE_CXX_FLAGS) endif(DEFINED USER_CMAKE_CXX_FLAGS)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View File

@ -170,3 +170,8 @@ add_library(${Output} STATIC ${UtilitiesSources} ${UtilitiesHeaders} ${Utilities
# link target with wx # link target with wx
target_link_libraries(${Output} ${wxWidgets_LIBRARIES}) target_link_libraries(${Output} ${wxWidgets_LIBRARIES})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -143,3 +143,8 @@ add_library(${Output} STATIC ${x86emitterSources} ${x86emitterHeaders})
# link target with wx # link target with wx
target_link_libraries(${Output} ${wxWidgets_LIBRARIES}) target_link_libraries(${Output} ${wxWidgets_LIBRARIES})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -641,3 +641,8 @@ endif(Linux)
# link target with zlib # link target with zlib
target_link_libraries(${Output} ${ZLIB_LIBRARIES}) target_link_libraries(${Output} ${ZLIB_LIBRARIES})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -79,3 +79,8 @@ set_target_properties(${Output} PROPERTIES
# Link with bz2 # Link with bz2
target_link_libraries(${Output} ${BZIP2_LIBRARIES}) target_link_libraries(${Output} ${BZIP2_LIBRARIES})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -91,3 +91,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -65,3 +65,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -77,3 +77,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -95,3 +95,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -79,3 +79,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -76,3 +76,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -78,3 +78,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -75,3 +75,8 @@ add_library(${Output} SHARED
# set output directory # set output directory
set_target_properties(${Output} PROPERTIES set_target_properties(${Output} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -87,3 +87,8 @@ set_target_properties(${Output} PROPERTIES
# link target with SDL # link target with SDL
target_link_libraries(${Output} ${SDL_LIBRARY}) target_link_libraries(${Output} ${SDL_LIBRARY})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -126,3 +126,8 @@ target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES})
# link target with A52 # link target with A52
target_link_libraries(${Output} ${A52_LIBRARIES}) target_link_libraries(${Output} ${A52_LIBRARIES})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -137,3 +137,8 @@ target_link_libraries(${Output} ${X11_LIBRARIES})
# link target with X11 videomod # link target with X11 videomod
target_link_libraries(${Output} ${X11_Xxf86vm_LIB}) target_link_libraries(${Output} ${X11_Xxf86vm_LIB})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -96,3 +96,8 @@ set_target_properties(${Output} PROPERTIES
# link target with SDL # link target with SDL
target_link_libraries(${Output} ${SDL_LIBRARY}) target_link_libraries(${Output} ${SDL_LIBRARY})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -106,3 +106,8 @@ endif(PORTAUDIO_FOUND)
# link target with SoundTouch # link target with SoundTouch
target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES}) target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -157,3 +157,8 @@ target_link_libraries(${Output} ${X11_LIBRARIES})
# link target with X11 videomod # link target with X11 videomod
target_link_libraries(${Output} ${X11_Xxf86vm_LIB}) target_link_libraries(${Output} ${X11_Xxf86vm_LIB})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")