Unverified Commit 3707ba7d authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #720

Fix LDFLAG handling with whitespaces
parents dbebe716 8490a3b6
...@@ -128,12 +128,6 @@ else() ...@@ -128,12 +128,6 @@ else()
set(CAF_NO_PYTHON yes) set(CAF_NO_PYTHON yes)
endif() endif()
################################################################################
# respect environment variables #
################################################################################
set(LDFLAGS $ENV{LDFLAGS})
################################################################################ ################################################################################
# get version of CAF # # get version of CAF #
################################################################################ ################################################################################
...@@ -317,7 +311,7 @@ if(MINGW) ...@@ -317,7 +311,7 @@ if(MINGW)
add_definitions(-D_WIN32_WINNT=0x0600) add_definitions(-D_WIN32_WINNT=0x0600)
add_definitions(-DWIN32) add_definitions(-DWIN32)
include(GenerateExportHeader) include(GenerateExportHeader)
list(APPEND LDFLAGS -lws2_32 -liphlpapi -lpsapi) list(APPEND CAF_EXTRA_LDFLAGS -lws2_32 -liphlpapi -lpsapi)
# build static to avoid runtime dependencies to GCC libraries # build static to avoid runtime dependencies to GCC libraries
build_string("EXTRA_FLAGS" "-static") build_string("EXTRA_FLAGS" "-static")
elseif(CYGWIN) elseif(CYGWIN)
...@@ -326,7 +320,7 @@ else() ...@@ -326,7 +320,7 @@ else()
build_string("EXTRA_FLAGS" "-fPIC") build_string("EXTRA_FLAGS" "-fPIC")
endif() endif()
if (WIN32) if (WIN32)
list(APPEND LDFLAGS ws2_32 iphlpapi) list(APPEND CAF_EXTRA_LDFLAGS ws2_32 iphlpapi)
endif() endif()
# iOS support # iOS support
if(CAF_OSX_SYSROOT) if(CAF_OSX_SYSROOT)
...@@ -601,7 +595,7 @@ if(NOT CAF_NO_UNIT_TESTS) ...@@ -601,7 +595,7 @@ if(NOT CAF_NO_UNIT_TESTS)
libcaf_test/caf/test/unit_test_impl.hpp libcaf_test/caf/test/unit_test_impl.hpp
${CAF_ALL_UNIT_TESTS}) ${CAF_ALL_UNIT_TESTS})
target_link_libraries(caf-test target_link_libraries(caf-test
${LDFLAGS} ${CAF_EXTRA_LDFLAGS}
${CAF_LIBRARIES} ${CAF_LIBRARIES}
${PTHREAD_LIBRARIES}) ${PTHREAD_LIBRARIES})
add_custom_target(all_unit_tests) add_custom_target(all_unit_tests)
...@@ -753,6 +747,8 @@ invertYesNo(CAF_NO_PYTHON CAF_BUILD_PYTHON) ...@@ -753,6 +747,8 @@ invertYesNo(CAF_NO_PYTHON CAF_BUILD_PYTHON)
# collect all compiler flags # collect all compiler flags
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
set(ALL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE}}") set(ALL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE}}")
set(ALL_LD_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CAF_EXTRA_LDFLAGS}")
string(STRIP "${ALL_LD_FLAGS}" ALL_LD_FLAGS)
# done # done
if(NOT CAF_NO_SUMMARY) if(NOT CAF_NO_SUMMARY)
message(STATUS message(STATUS
...@@ -780,7 +776,7 @@ if(NOT CAF_NO_SUMMARY) ...@@ -780,7 +776,7 @@ if(NOT CAF_NO_SUMMARY)
"\n" "\n"
"\nCXX: ${CMAKE_CXX_COMPILER}" "\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${ALL_CXX_FLAGS}" "\nCXXFLAGS: ${ALL_CXX_FLAGS}"
"\nLDFLAGS: ${LDFLAGS}" "\nLINKER_FLAGS (shared) ${ALL_LD_FLAGS}"
"\n" "\n"
"\nSource directory: ${CMAKE_CURRENT_SOURCE_DIR}" "\nSource directory: ${CMAKE_CURRENT_SOURCE_DIR}"
"\nBuild directory: ${CMAKE_CURRENT_BINARY_DIR}" "\nBuild directory: ${CMAKE_CURRENT_BINARY_DIR}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment