You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by cl...@apache.org on 2015/07/11 21:46:38 UTC
qpid-proton git commit: PROTON-865: get cpp working on Windows
vs2008-vs2013
Repository: qpid-proton
Updated Branches:
refs/heads/cjansen-cpp-client 6498cf6d0 -> 1d312501b
PROTON-865: get cpp working on Windows vs2008-vs2013
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1d312501
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1d312501
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1d312501
Branch: refs/heads/cjansen-cpp-client
Commit: 1d312501b5592843312d5a9806a741d94372323e
Parents: 6498cf6
Author: Clifford Jansen <cl...@apache.org>
Authored: Sat Jul 11 12:45:01 2015 -0700
Committer: Clifford Jansen <cl...@apache.org>
Committed: Sat Jul 11 12:45:01 2015 -0700
----------------------------------------------------------------------
examples/cpp/CMakeLists.txt | 11 +++++++----
examples/cpp/example_test.py | 15 +++++++++------
proton-c/bindings/cpp/CMakeLists.txt | 4 ++--
proton-c/bindings/cpp/include/proton/type_traits.hpp | 2 ++
4 files changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d312501/examples/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index 7309b9e..7ee1509 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -34,12 +34,15 @@ foreach(example
set_source_files_properties(${example}.cpp PROPERTIES COMPILE_FLAGS "${CXX_WARNING_FLAGS}")
endforeach()
-set(TEST_DIR ${CMAKE_CURRENT_BINARY_DIR})
+set(env_py "${CMAKE_SOURCE_DIR}/proton-c/env.py")
+set(test_bin_dir "$<TARGET_FILE_DIR:broker>")
if (WIN32)
- set(TEST_DIR ${TEST_DIR}/${CMAKE_BUILD_TYPE})
+ set(test_path "${test_bin_dir}" "$<TARGET_FILE_DIR:qpid-proton>" "$<TARGET_FILE_DIR:qpid-proton-cpp>")
+else(WIN32)
+ set(test_path "${test_bin_dir}")
endif(WIN32)
add_test(
NAME cpp_example_test
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v
- WORKING_DIRECTORY ${TEST_DIR})
+ COMMAND ${PYTHON_EXECUTABLE} ${env_py} -- "PATH=${test_path}"
+ ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v)
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d312501/examples/cpp/example_test.py
----------------------------------------------------------------------
diff --git a/examples/cpp/example_test.py b/examples/cpp/example_test.py
index 797f1a3..03c5b49 100644
--- a/examples/cpp/example_test.py
+++ b/examples/cpp/example_test.py
@@ -25,14 +25,14 @@ from random import randrange
from subprocess import Popen, PIPE, STDOUT
import platform
-def exe_path(name):
- path = os.path.abspath(name)
- if platform.system() == "Windows": path += ".exe"
- return path
+def exe_name(name):
+ if platform.system() == "Windows":
+ return name + ".exe"
+ return name
def execute(*args):
"""Run executable and return its output"""
- args = [exe_path(args[0])]+list(args[1:])
+ args = [exe_name(args[0])]+list(args[1:])
try:
p = Popen(args, stdout=PIPE, stderr=STDOUT)
out, err = p.communicate()
@@ -44,6 +44,9 @@ vvvvvvvvvvvvvvvv
%s
^^^^^^^^^^^^^^^^
""" % (args[0], p.returncode, out))
+ if platform.system() == "Windows":
+ # Just \n please
+ out = out.translate(None, '\r')
return out
NULL = open(os.devnull, 'w')
@@ -66,7 +69,7 @@ class Broker(object):
def __init__(self):
self.port = randrange(10000, 20000)
self.addr = ":%s" % self.port
- cmd = [exe_path("broker"), self.addr]
+ cmd = [exe_name("broker"), self.addr]
try:
self.process = Popen(cmd, stdout=NULL, stderr=NULL)
except Exception as e:
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d312501/proton-c/bindings/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt
index 1a0129f..6b56a8e 100644
--- a/proton-c/bindings/cpp/CMakeLists.txt
+++ b/proton-c/bindings/cpp/CMakeLists.txt
@@ -23,7 +23,7 @@ include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "${CXX_WARNING_FLAGS}")
check_cxx_source_compiles("long long ll; int main(int, char**) { return 0; }" HAVE_LONG_LONG)
if (HAVE_LONG_LONG)
- add_definitions(-DHAVE_LONG_LONG=1)
+ add_definitions(-DPN_HAVE_LONG_LONG=1)
endif()
include_directories(
@@ -103,7 +103,7 @@ macro(add_cpp_test test)
add_test (NAME cpp_${test}
COMMAND ${env_py}
"PATH=$<TARGET_FILE_DIR:qpid-proton>"
- ${test}> ${ARGN})
+ $<TARGET_FILE:${test}> ${ARGN})
else ()
add_test (NAME cpp_${test} COMMAND ${memcheck-cmd} ${test} ${ARGN})
endif ()
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d312501/proton-c/bindings/cpp/include/proton/type_traits.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/type_traits.hpp b/proton-c/bindings/cpp/include/proton/type_traits.hpp
index b804e77..4f02214 100644
--- a/proton-c/bindings/cpp/include/proton/type_traits.hpp
+++ b/proton-c/bindings/cpp/include/proton/type_traits.hpp
@@ -25,6 +25,8 @@
#if defined(__cplusplus) && __cplusplus >= 201100
#include <type_traits>
+#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 150030729
+#include <type_traits>
#else
/**
* Workaround missing std:: classes on older C++ compilers. NOTE: this is NOT a
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org