You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/02/11 18:33:45 UTC
qpid-proton git commit: PROTON-1403: c proactor fix example test
Repository: qpid-proton
Updated Branches:
refs/heads/master 1d4fe545e -> 03071a1db
PROTON-1403: c proactor fix example test
Fix incorrect use of check_function_exists() in example CMakeLists.txt
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/03071a1d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/03071a1d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/03071a1d
Branch: refs/heads/master
Commit: 03071a1db2cc950a8f8624116151edb7ba846321
Parents: 1d4fe54
Author: Alan Conway <ac...@redhat.com>
Authored: Sat Feb 11 12:31:09 2017 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Sat Feb 11 12:31:09 2017 -0500
----------------------------------------------------------------------
examples/c/CMakeLists.txt | 7 +------
examples/c/proactor/CMakeLists.txt | 13 ++++++++++++-
2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/03071a1d/examples/c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt
index b2f36d3..0fed71b 100644
--- a/examples/c/CMakeLists.txt
+++ b/examples/c/CMakeLists.txt
@@ -19,13 +19,8 @@
find_package(Proton REQUIRED)
include(CheckCCompilerFlag)
-include(CheckFunctionExists)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-check_function_exists(pn_proactor, HAS_PROACTOR)
-if (HAS_PROACTOR)
- add_subdirectory(proactor)
-endif()
-
+add_subdirectory(proactor)
add_subdirectory(messenger)
add_subdirectory(reactor)
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/03071a1d/examples/c/proactor/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/c/proactor/CMakeLists.txt b/examples/c/proactor/CMakeLists.txt
index 2ed4f94..7fec1c6 100644
--- a/examples/c/proactor/CMakeLists.txt
+++ b/examples/c/proactor/CMakeLists.txt
@@ -18,9 +18,19 @@
#
find_package(Proton REQUIRED)
-
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${Proton_INCLUDE_DIRS})
+# Check if the proton library has a proactor implementation.
+include(CheckFunctionExists)
+include(CMakePushCheckState)
+cmake_push_check_state()
+set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Proton_LIBRARIES})
+check_function_exists(pn_proactor HAS_PROACTOR)
+cmake_pop_check_state()
+
+if (HAS_PROACTOR)
+
add_definitions(${COMPILE_WARNING_FLAGS} ${WERROR} ${COMPILE_PLATFORM_FLAGS} ${LINK_TIME_OPTIMIZATION})
# Add a test with the correct environment to find test executables and valgrind.
@@ -40,3 +50,4 @@ endforeach()
set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV} "PATH=${test_path}" ${VALGRIND_ENV})
add_test(c-proactor ${run_env} -- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py -v)
+endif()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org