Unverified Commit 37f76270 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #721

Update LD_FLAGS/LDFLAGS in subprojects, ensure the C++ standard is set to 11
parents 696736e4 4fc7911a
...@@ -339,6 +339,10 @@ endif() ...@@ -339,6 +339,10 @@ endif()
if(NOT CMAKE_CXX_FLAGS) if(NOT CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "-std=c++11 -Wextra -Wall -pedantic ${EXTRA_FLAGS}") set(CMAKE_CXX_FLAGS "-std=c++11 -Wextra -Wall -pedantic ${EXTRA_FLAGS}")
endif() endif()
if (NOT "${CMAKE_CXX_FLAGS}" MATCHES "-std=")
message(STATUS "Supplied CXXFLAGS do not contain a C++ standard, setting std to c++11")
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()
if(NOT CMAKE_CXX_FLAGS_DEBUG) if(NOT CMAKE_CXX_FLAGS_DEBUG)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
endif() endif()
......
...@@ -14,19 +14,7 @@ use this configure script to access CMake equivalent functionality.\ ...@@ -14,19 +14,7 @@ use this configure script to access CMake equivalent functionality.\
command="$0 $*" command="$0 $*"
dirname_0=`dirname $0` dirname_0=`dirname $0`
sourcedir=`cd $dirname_0 && pwd` sourcedir=`cd $dirname_0 && pwd`
benchmark_suite_options=""
if [ -d "$sourcedir/benchmarks/caf" ] ; then
benchmark_suite_options="\
Benchmark Suite Options:
--with-javac=FILE path to Java compiler
--with-java=FILE path to Java Runtime
--with-scalac=FILE path to Scala compiler
--with-erlc=FILE path to Erlang compiler
--with-charmc=FILE path to Charm++ compiler
--with-salsa=FILE path to SALSA Lite jar
"
fi
usage="\ usage="\
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
...@@ -56,14 +44,16 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -56,14 +44,16 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--warnings-as-errors build with '-Werror' --warnings-as-errors build with '-Werror'
--with-ccache use ccache to improve build performance --with-ccache use ccache to improve build performance
Additional Examples:
--with-qt-examples include Qt example(s)
--with-protobuf-examples include Google Protobuf example(s)
Installation Directories: Installation Directories:
--prefix=PREFIX installation directory [/usr/local] --prefix=PREFIX installation directory [/usr/local]
Remove Standard Features (even if all dependencies are available): Remove Standard Features (even if all dependencies are available):
--no-memory-management build without memory management --no-memory-management build without memory management
--no-examples build without examples --no-examples build without examples
--no-qt-examples build without Qt examples
--no-protobuf-examples build without Google Protobuf examples
--no-curl-examples build without libcurl examples --no-curl-examples build without libcurl examples
--no-unit-tests build without unit tests --no-unit-tests build without unit tests
--no-opencl build without OpenCL module --no-opencl build without OpenCL module
...@@ -103,7 +93,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -103,7 +93,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
- iphoneos: for iOS device - iphoneos: for iOS device
- iphonesimulator: for iOS simulator - iphonesimulator: for iOS simulator
--ios-min-ver=VERSION set the ios deployment target version --ios-min-ver=VERSION set the ios deployment target version
$benchmark_suite_options" "
# Appends a CMake cache entry definition to the CMakeCacheEntries variable. # Appends a CMake cache entry definition to the CMakeCacheEntries variable.
...@@ -338,11 +328,11 @@ while [ $# -ne 0 ]; do ...@@ -338,11 +328,11 @@ while [ $# -ne 0 ]; do
--no-examples) --no-examples)
append_cache_entry CAF_NO_EXAMPLES BOOL yes append_cache_entry CAF_NO_EXAMPLES BOOL yes
;; ;;
--no-qt-examples) --with-qt-examples)
append_cache_entry CAF_NO_QT_EXAMPLES BOOL yes append_cache_entry CAF_BUILD_QT_EXAMPLES BOOL yes
;; ;;
--no-protobuf-examples) --with-protobuf-examples)
append_cache_entry CAF_NO_PROTOBUF_EXAMPLES BOOL yes append_cache_entry CAF_BUILD_PROTOBUF_EXAMPLES BOOL yes
;; ;;
--no-curl-examples) --no-curl-examples)
append_cache_entry CAF_NO_CURL_EXAMPLES BOOL yes append_cache_entry CAF_NO_CURL_EXAMPLES BOOL yes
...@@ -365,24 +355,6 @@ while [ $# -ne 0 ]; do ...@@ -365,24 +355,6 @@ while [ $# -ne 0 ]; do
--static-runtime) --static-runtime)
append_cache_entry CAF_BUILD_STATIC_RUNTIME BOOL yes append_cache_entry CAF_BUILD_STATIC_RUNTIME BOOL yes
;; ;;
--with-javac=*)
append_cache_entry CAF_JAVA_COMPILER FILEPATH "$optarg"
;;
--with-java=*)
append_cache_entry CAF_JAVA_BIN FILEPATH "$optarg"
;;
--with-scalac=*)
append_cache_entry CAF_SCALA_COMPILER FILEPATH "$optarg"
;;
--with-erlc=*)
append_cache_entry CAF_ERLANG_COMPILER FILEPATH "$optarg"
;;
--with-charmc=*)
append_cache_entry CAF_CHARM_COMPILER FILEPATH "$optarg"
;;
--with-salsa=*)
append_cache_entry CAF_SALSA_JAR FILEPATH "$optarg"
;;
--with-python-config=*) --with-python-config=*)
append_cache_entry CAF_PYTHON_CONFIG_BIN FILEPATH "$optarg" append_cache_entry CAF_PYTHON_CONFIG_BIN FILEPATH "$optarg"
;; ;;
......
...@@ -53,7 +53,7 @@ add(remoting distributed_calculator) ...@@ -53,7 +53,7 @@ add(remoting distributed_calculator)
add(broker simple_broker) add(broker simple_broker)
add(broker simple_http_broker) add(broker simple_http_broker)
if(NOT CAF_NO_PROTOBUF_EXAMPLES) if(CAF_BUILD_PROTOBUF_EXAMPLES)
find_package(Protobuf) find_package(Protobuf)
if(PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE) if(PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE)
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders "${CMAKE_CURRENT_SOURCE_DIR}/remoting/pingpong.proto") PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders "${CMAKE_CURRENT_SOURCE_DIR}/remoting/pingpong.proto")
...@@ -66,7 +66,7 @@ if(NOT CAF_NO_PROTOBUF_EXAMPLES) ...@@ -66,7 +66,7 @@ if(NOT CAF_NO_PROTOBUF_EXAMPLES)
endif(PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE) endif(PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE)
endif() endif()
if(NOT CAF_NO_QT_EXAMPLES) if(CAF_BUILD_QT_EXAMPLES)
find_package(Qt5 COMPONENTS Core Gui Widgets QUIET) find_package(Qt5 COMPONENTS Core Gui Widgets QUIET)
if(Qt5_FOUND) if(Qt5_FOUND)
message(STATUS "Found Qt5") message(STATUS "Found Qt5")
......
...@@ -134,7 +134,7 @@ add_custom_target(libcaf_core) ...@@ -134,7 +134,7 @@ add_custom_target(libcaf_core)
# build shared library if not compiling static only # build shared library if not compiling static only
if (NOT CAF_BUILD_STATIC_ONLY) if (NOT CAF_BUILD_STATIC_ONLY)
add_library(libcaf_core_shared SHARED ${LIBCAF_CORE_SRCS} ${LIBCAF_CORE_HDRS}) add_library(libcaf_core_shared SHARED ${LIBCAF_CORE_SRCS} ${LIBCAF_CORE_HDRS})
target_link_libraries(libcaf_core_shared ${LD_FLAGS}) target_link_libraries(libcaf_core_shared ${CAF_EXTRA_LDFLAGS})
set_target_properties(libcaf_core_shared set_target_properties(libcaf_core_shared
PROPERTIES PROPERTIES
SOVERSION ${CAF_VERSION} SOVERSION ${CAF_VERSION}
...@@ -151,7 +151,7 @@ endif () ...@@ -151,7 +151,7 @@ endif ()
# build static library only if --build-static or --build-static-only was set # build static library only if --build-static or --build-static-only was set
if (CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC) if (CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC)
add_library(libcaf_core_static STATIC ${LIBCAF_CORE_HDRS} ${LIBCAF_CORE_SRCS}) add_library(libcaf_core_static STATIC ${LIBCAF_CORE_HDRS} ${LIBCAF_CORE_SRCS})
target_link_libraries(libcaf_core_static ${LD_FLAGS}) target_link_libraries(libcaf_core_static ${CAF_EXTRA_LDFLAGS})
set_target_properties(libcaf_core_static PROPERTIES OUTPUT_NAME caf_core_static) set_target_properties(libcaf_core_static PROPERTIES OUTPUT_NAME caf_core_static)
install(TARGETS libcaf_core_static ARCHIVE DESTINATION lib) install(TARGETS libcaf_core_static ARCHIVE DESTINATION lib)
add_dependencies(libcaf_core_static libcaf_core) add_dependencies(libcaf_core_static libcaf_core)
......
...@@ -54,7 +54,7 @@ add_custom_target(libcaf_io) ...@@ -54,7 +54,7 @@ add_custom_target(libcaf_io)
# build shared library if not compiling static only # build shared library if not compiling static only
if (NOT CAF_BUILD_STATIC_ONLY) if (NOT CAF_BUILD_STATIC_ONLY)
add_library(libcaf_io_shared SHARED ${LIBCAF_IO_SRCS} ${LIBCAF_IO_HDRS}) add_library(libcaf_io_shared SHARED ${LIBCAF_IO_SRCS} ${LIBCAF_IO_HDRS})
target_link_libraries(libcaf_io_shared ${LDFLAGS} ${CAF_LIBRARY_CORE}) target_link_libraries(libcaf_io_shared ${CAF_EXTRA_LDFLAGS} ${CAF_LIBRARY_CORE})
set_target_properties(libcaf_io_shared set_target_properties(libcaf_io_shared
PROPERTIES PROPERTIES
SOVERSION ${CAF_VERSION} SOVERSION ${CAF_VERSION}
...@@ -71,7 +71,7 @@ endif () ...@@ -71,7 +71,7 @@ endif ()
# build static library only if --build-static or --build-static-only was set # build static library only if --build-static or --build-static-only was set
if (CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC) if (CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC)
add_library(libcaf_io_static STATIC ${LIBCAF_IO_HDRS} ${LIBCAF_IO_SRCS}) add_library(libcaf_io_static STATIC ${LIBCAF_IO_HDRS} ${LIBCAF_IO_SRCS})
target_link_libraries(libcaf_io_static ${LDFLAGS} ${CAF_LIBRARY_CORE_STATIC}) target_link_libraries(libcaf_io_static ${CAF_EXTRA_LDFLAGS} ${CAF_LIBRARY_CORE_STATIC})
set_target_properties(libcaf_io_static PROPERTIES OUTPUT_NAME caf_io_static) set_target_properties(libcaf_io_static PROPERTIES OUTPUT_NAME caf_io_static)
install(TARGETS libcaf_io_static ARCHIVE DESTINATION lib) install(TARGETS libcaf_io_static ARCHIVE DESTINATION lib)
add_dependencies(libcaf_io_static libcaf_io) add_dependencies(libcaf_io_static libcaf_io)
......
...@@ -21,7 +21,7 @@ set(LIBCAF_OPENCL_SRCS ...@@ -21,7 +21,7 @@ set(LIBCAF_OPENCL_SRCS
if(NOT CAF_BUILD_STATIC_ONLY) if(NOT CAF_BUILD_STATIC_ONLY)
add_library(libcaf_opencl_shared SHARED ${LIBCAF_OPENCL_SRCS} add_library(libcaf_opencl_shared SHARED ${LIBCAF_OPENCL_SRCS}
${LIBCAF_OPENCL_HDRS} ${OpenCL_INCLUDE_DIRS}) ${LIBCAF_OPENCL_HDRS} ${OpenCL_INCLUDE_DIRS})
target_link_libraries(libcaf_opencl_shared ${LD_FLAGS} target_link_libraries(libcaf_opencl_shared ${CAF_EXTRA_LDFLAGS}
${CAF_LIBRARY_CORE} ${CAF_LIBRARY_CORE}
${OpenCL_LIBRARIES}) ${OpenCL_LIBRARIES})
set_target_properties(libcaf_opencl_shared set_target_properties(libcaf_opencl_shared
...@@ -39,7 +39,7 @@ if(CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC) ...@@ -39,7 +39,7 @@ if(CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC)
add_library(libcaf_opencl_static STATIC ${LIBCAF_OPENCL_SRCS} add_library(libcaf_opencl_static STATIC ${LIBCAF_OPENCL_SRCS}
${LIBCAF_OPENCL_HDRS} ${LIBCAF_OPENCL_HDRS}
${OpenCL_INCLUDE_DIRS}) ${OpenCL_INCLUDE_DIRS})
target_link_libraries(libcaf_opencl_static ${LD_FLAGS} target_link_libraries(libcaf_opencl_static ${CAF_EXTRA_LDFLAGS}
${CAF_LIBRARY_CORE_STATIC} ${CAF_LIBRARY_CORE_STATIC}
${OpenCL_LIBRARIES}) ${OpenCL_LIBRARIES})
set_target_properties(libcaf_opencl_static PROPERTIES OUTPUT_NAME caf_opencl_static) set_target_properties(libcaf_opencl_static PROPERTIES OUTPUT_NAME caf_opencl_static)
......
...@@ -12,7 +12,7 @@ if(OpenCL_LIBRARIES AND NOT CAF_NO_EXAMPLES) ...@@ -12,7 +12,7 @@ if(OpenCL_LIBRARIES AND NOT CAF_NO_EXAMPLES)
macro(add name folder) macro(add name folder)
add_executable(${name} ${folder}/${name}.cpp ${ARGN}) add_executable(${name} ${folder}/${name}.cpp ${ARGN})
target_link_libraries(${name} target_link_libraries(${name}
${LD_FLAGS} ${CAF_EXTRA_LDFLAGS}
${CAF_LIBRARIES} ${CAF_LIBRARIES}
${PTHREAD_LIBRARIES} ${PTHREAD_LIBRARIES}
${WSLIB} ${WSLIB}
......
...@@ -23,7 +23,7 @@ endif() ...@@ -23,7 +23,7 @@ endif()
if (NOT CAF_BUILD_STATIC_ONLY) if (NOT CAF_BUILD_STATIC_ONLY)
add_library(libcaf_openssl_shared SHARED add_library(libcaf_openssl_shared SHARED
${LIBCAF_OPENSSL_SRCS} ${LIBCAF_OPENSSL_HDRS}) ${LIBCAF_OPENSSL_SRCS} ${LIBCAF_OPENSSL_HDRS})
target_link_libraries(libcaf_openssl_shared ${LD_FLAGS} target_link_libraries(libcaf_openssl_shared ${CAF_EXTRA_LDFLAGS}
${CAF_LIBRARY_CORE} ${CAF_LIBRARY_IO} ${OPENSSL_LIBRARIES}) ${CAF_LIBRARY_CORE} ${CAF_LIBRARY_IO} ${OPENSSL_LIBRARIES})
if(NOT APPLE AND NOT WIN32) if(NOT APPLE AND NOT WIN32)
...@@ -47,7 +47,7 @@ endif () ...@@ -47,7 +47,7 @@ endif ()
if (CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC) if (CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC)
add_library(libcaf_openssl_static STATIC add_library(libcaf_openssl_static STATIC
${LIBCAF_OPENSSL_HDRS} ${LIBCAF_OPENSSL_SRCS}) ${LIBCAF_OPENSSL_HDRS} ${LIBCAF_OPENSSL_SRCS})
target_link_libraries(libcaf_openssl_static ${LD_FLAGS} target_link_libraries(libcaf_openssl_static ${CAF_EXTRA_LDFLAGS}
${CAF_LIBRARY_CORE_STATIC} ${CAF_LIBRARY_IO_STATIC} ${OPENSSL_LIBRARIES}) ${CAF_LIBRARY_CORE_STATIC} ${CAF_LIBRARY_IO_STATIC} ${OPENSSL_LIBRARIES})
set_target_properties(libcaf_openssl_static PROPERTIES set_target_properties(libcaf_openssl_static PROPERTIES
OUTPUT_NAME caf_openssl_static) OUTPUT_NAME caf_openssl_static)
......
...@@ -13,10 +13,10 @@ else() ...@@ -13,10 +13,10 @@ else()
execute_process(COMMAND "${CAF_PYTHON_CONFIG_BIN}" --ldflags execute_process(COMMAND "${CAF_PYTHON_CONFIG_BIN}" --ldflags
OUTPUT_VARIABLE PYTHON_LDFLAGS) OUTPUT_VARIABLE PYTHON_LDFLAGS)
string(STRIP "${PYTHON_LDFLAGS}" PYTHON_LDFLAGS) string(STRIP "${PYTHON_LDFLAGS}" PYTHON_LDFLAGS)
if ("${LD_FLAGS}" STREQUAL "") if ("${CAF_EXTRA_LDFLAGS}" STREQUAL "")
set(LD_FLAGS "${PYTHON_LDFLAGS}") set(CAF_EXTRA_LDFLAGS "${PYTHON_LDFLAGS}")
else() else()
set(LD_FLAGS "${LD_FLAGS} ${PYTHON_LDFLAGS}") set(CAF_EXTRA_LDFLAGS "${CAF_EXTRA_LDFLAGS} ${PYTHON_LDFLAGS}")
endif() endif()
string(REPLACE " -I" ";-I" dir_list ${PYTHON_INCLUDE_FLAGS}) string(REPLACE " -I" ";-I" dir_list ${PYTHON_INCLUDE_FLAGS})
foreach(flag ${dir_list}) foreach(flag ${dir_list})
...@@ -46,7 +46,7 @@ if(NOT CAF_NO_PYTHON) ...@@ -46,7 +46,7 @@ if(NOT CAF_NO_PYTHON)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(caf-python ${CAF_PYTHON_SRCS} ${CAF_PYTHON_HDRS}) add_executable(caf-python ${CAF_PYTHON_SRCS} ${CAF_PYTHON_HDRS})
target_link_libraries(caf-python target_link_libraries(caf-python
${LD_FLAGS} ${CAF_EXTRA_LDFLAGS}
${CAF_LIBRARY_CORE} ${CAF_LIBRARY_CORE}
${CAF_LIBRARY_IO} ${CAF_LIBRARY_IO}
${CAF_LIBRARY_RIAC} ${CAF_LIBRARY_RIAC}
......
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