Commit f979b834 authored by Dominik Charousset's avatar Dominik Charousset

Respect LDFLAG, {DEFAULT_ => }CMAKE_GENERATOR

parent 2c95a660
......@@ -134,6 +134,12 @@ else()
set(CAF_NO_PYTHON yes)
endif()
################################################################################
# respect environment variables #
################################################################################
set(LDFLAGS "$ENV{LDFLAGS}")
################################################################################
# get version of CAF #
################################################################################
......@@ -316,7 +322,7 @@ if(MINGW)
add_definitions(-D_WIN32_WINNT=0x0600)
add_definitions(-DWIN32)
include(GenerateExportHeader)
set(LD_FLAGS "ws2_32 -liphlpapi -lpsapi")
set(LDFLAGS "${LDFLAGS} ws2_32 -liphlpapi -lpsapi")
# build static to avoid runtime dependencies to GCC libraries
set(EXTRA_FLAGS "${EXTRA_FLAGS} -static")
elseif(CYGWIN)
......@@ -325,7 +331,7 @@ else()
set(EXTRA_FLAGS "${EXTRA_FLAGS} -fPIC")
endif()
if (WIN32)
set(LD_FLAGS ${LD_FLAGS} ws2_32 iphlpapi)
set(LDFLAGS "${LDFLAGS} ws2_32 iphlpapi")
endif()
# iOS support
if(CAF_OSX_SYSROOT)
......@@ -359,7 +365,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
# needed by subprojects
set(LD_FLAGS ${LD_FLAGS} ${CMAKE_LD_LIBS})
set(LDFLAGS ${LDFLAGS} ${CMAKE_LD_LIBS})
################################################################################
# configure build_config.hpp header #
......@@ -391,7 +397,7 @@ if(CAF_USE_ASIO)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
set(LD_DIRS ${LD_DIRS} ${Boost_LIBRARIES})
set(LD_FLAGS ${LD_FLAGS} ${Boost_SYSTEM_LIBRARY})
set(LDFLAGS ${LDFLAGS} ${Boost_SYSTEM_LIBRARY})
set(CAF_USE_ASIO_INT 1)
else()
set(CAF_USE_ASIO no)
......@@ -611,7 +617,7 @@ if(NOT CAF_NO_UNIT_TESTS)
libcaf_test/caf/test/unit_test_impl.hpp
${CAF_ALL_UNIT_TESTS})
target_link_libraries(caf-test
${LD_FLAGS}
${LDFLAGS}
${CAF_LIBRARIES}
${PTHREAD_LIBRARIES})
add_custom_target(all_unit_tests)
......@@ -795,7 +801,7 @@ if(NOT CAF_NO_SUMMARY)
"\n"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${ALL_CXX_FLAGS}"
"\nLIBRARIES: ${LD_FLAGS}"
"\nLDFLAGS: ${LDFLAGS}"
"\n"
"\nSource directory: ${CMAKE_CURRENT_SOURCE_DIR}"
"\nBuild directory: ${CMAKE_CURRENT_BINARY_DIR}"
......
......@@ -91,7 +91,8 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
Influential Environment Variables (only on first invocation):
CXX C++ compiler command
CXXFLAGS C++ compiler flags
DEFAULT_CMAKE_GENERATOR Selects a custom generator
LDFLAGS Additional linker flags
CMAKE_GENERATOR Selects a custom generator
Python Build Options:
--with-python-config=FILE Use python-conf binary to determine includes and libs
......@@ -199,6 +200,9 @@ configure ()
if [ -n "$CXXFLAGS" ]; then
printf "CXXFLAGS=\"%s\"\n" "$CXXFLAGS" >> config.status
fi
if [ -n "$LDFLAGS" ]; then
printf "LDFLAGS=\"%s\"\n" "$LDFLAGS" >> config.status
fi
echo $command >> config.status
chmod u+x config.status
}
......@@ -210,8 +214,8 @@ append_cache_entry CMAKE_INSTALL_PREFIX PATH /usr/local
append_cache_entry CAF_ENABLE_RUNTIME_CHECKS BOOL false
# parse custom environment variable to initialize CMakeGenerator
if [ -n "$DEFAULT_CMAKE_GENERATOR" ]; then
CMakeGenerator="$DEFAULT_CMAKE_GENERATOR"
if [ -n "$CMAKE_GENERATOR" ]; then
CMakeGenerator="$CMAKE_GENERATOR"
fi
# Parse arguments.
......
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