PROTON-1633: Need to allow examples to link with special flags to get sanitizers to work
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/89c8b5fa Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/89c8b5fa Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/89c8b5fa Branch: refs/heads/go1 Commit: 89c8b5fa0b4f529b3e2c27434c02f29a7afdaac0 Parents: c7f593e Author: Andrew Stitcher <astitc...@apache.org> Authored: Wed Oct 18 10:30:12 2017 -0400 Committer: Andrew Stitcher <astitc...@apache.org> Committed: Wed Oct 18 10:30:12 2017 -0400 ---------------------------------------------------------------------- examples/c/CMakeLists.txt | 3 ++- examples/cpp/CMakeLists.txt | 2 ++ proton-c/CMakeLists.txt | 2 ++ proton-c/bindings/cpp/CMakeLists.txt | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89c8b5fa/examples/c/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 4d0d52d..dd1feb4 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -38,7 +38,8 @@ foreach (name broker send receive direct send-abort send-ssl) add_executable(c-${name} ${name}.c) target_link_libraries(c-${name} ${Proton_Proactor_LIBRARIES} ${Proton_Core_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) set_target_properties(c-${name} PROPERTIES - OUTPUT_NAME ${name}) + OUTPUT_NAME ${name} + LINK_FLAGS "${C_EXAMPLE_LINK_FLAGS}") endforeach() set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV} "PATH=${test_path}" ${VALGRIND_ENV}) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89c8b5fa/examples/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index e83732f..037285d 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -71,6 +71,7 @@ foreach(example ssl_client_cert encode_decode) add_executable(${example} ${example}.cpp) + set_target_properties(${example} PROPERTIES LINK_FLAGS "${CXX_EXAMPLE_LINK_FLAGS}") endforeach() if(HAS_CPP11) @@ -82,6 +83,7 @@ if(HAS_CPP11) multithreaded_client_flow_control ) add_executable(${example} ${example}.cpp) + set_target_properties(${example} PROPERTIES LINK_FLAGS "${CXX_EXAMPLE_LINK_FLAGS}") endforeach() endif() http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89c8b5fa/proton-c/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt index 98d53c1..4cd4bd5 100644 --- a/proton-c/CMakeLists.txt +++ b/proton-c/CMakeLists.txt @@ -296,6 +296,8 @@ endif() # Flags for example self-test build, CACHE INTERNAL for visibility set(C_EXAMPLE_FLAGS "${COMPILE_WARNING_FLAGS} ${CMAKE_C_FLAGS}" CACHE INTERNAL "") +set(C_EXAMPLE_LINK_FLAGS "${SANITIZE_FLAGS}" CACHE INTERNAL "") + if (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_COMPILER_IS_GNUCC) # Ensure that examples build with c90, to deal with older c++03-as-c compilers. set(C_EXAMPLE_FLAGS "${C_EXAMPLE_FLAGS} -std=iso9899:1990 -pedantic") http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89c8b5fa/proton-c/bindings/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt index 9d19385..b7f0d9f 100644 --- a/proton-c/bindings/cpp/CMakeLists.txt +++ b/proton-c/bindings/cpp/CMakeLists.txt @@ -62,6 +62,7 @@ endif () # Make these CACHE INTERNAL so they will be set for the C++ examples set(CXX_EXAMPLE_FLAGS "${CXX_WARNING_FLAGS} ${CMAKE_CXX_FLAGS} ${CXX_STANDARD}" CACHE INTERNAL "") +set(CXX_EXAMPLE_LINK_FLAGS "${SANITIZE_FLAGS}" CACHE INTERNAL "") include_directories( "${CMAKE_SOURCE_DIR}/proton-c/include" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org