@@ -37,9 +37,10 @@ find_package (SWIG)
3737find_package (CyrusSASL)
3838
3939enable_testing ()
40+ include (tests/PNAddTest.cmake)
4041
4142# Set up runtime checks (valgrind, sanitizers etc.)
42- include (tests/RuntimeCheck.cmake)
43+ include (tests/RuntimeCheck.cmake)
4344
4445## Variables used across components
4546
@@ -76,7 +77,7 @@ else (CMAKE_CONFIGURATION_TYPES)
7677 # There is a single build configuration
7778 # If the build type is not set then set the default
7879 if (NOT CMAKE_BUILD_TYPE )
79- set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE string
80+ set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
8081 "Build type: Debug, Release, RelWithDebInfo, MinSizeRel or Coverage (default RelWithDebInfo)" FORCE)
8182 endif ()
8283
@@ -113,12 +114,8 @@ endif()
113114# off if building there:
114115if (APPLE )
115116 set (NOENABLE_WARNING_ERROR ON )
116- set (NOENABLE_UNDEFINED_ERROR ON )
117117endif (APPLE )
118118
119- # Make LTO default to off until we can figure out the valgrind issues
120- set (NOENABLE_LINKTIME_OPTIMIZATION ON )
121-
122119# Add options here called <whatever> they will turn into "ENABLE_<whatever" and can be
123120# overridden on a platform specific basis above by NOENABLE_<whatever>
124121set (OPTIONS WARNING_ERROR UNDEFINED_ERROR LINKTIME_OPTIMIZATION HIDE_UNEXPORTED_SYMBOLS FUZZ_TESTING)
@@ -275,7 +272,7 @@ foreach (LANG ${BINDING_LANGS})
275272 endif ()
276273endforeach ()
277274
278- set (PROTON_SHARE ${SHARE_INSTALL_DIR} /proton- ${PN_VERSION} )
275+ set (PROTON_SHARE ${SHARE_INSTALL_DIR} /proton)
279276# End of variables used during install
280277
281278# Set result to a native search path - used by examples and binding tests.
@@ -289,17 +286,19 @@ macro(set_search_path result)
289286endmacro ()
290287
291288if (CMAKE_SYSTEM_NAME STREQUAL Windows)
292- # No change needed for windows already use correct separator
289+ # CMake uses semicolon as list separator. Change ';'->'\;'
293290 function (to_native_path path result)
294291 file (TO_NATIVE_PATH "${path} " path )
295- set (${result} ${path} PARENT_SCOPE)
292+ string (REPLACE ";" "\; " path "${path} " )
293+ # without this, ...;last\dir\ would later combine with list separator ; into \;
294+ set (${result} "${path} \; " PARENT_SCOPE)
296295 endfunction ()
297296else (CMAKE_SYSTEM_NAME STREQUAL Windows)
298297 # Just change ';'->':'
299298 function (to_native_path path result)
300299 file (TO_NATIVE_PATH "${path} " path )
301- string (REGEX REPLACE ";" ":" path "${path} " )
302- set (${result} ${path} PARENT_SCOPE)
300+ string (REPLACE ";" ":" path "${path} " )
301+ set (${result} " ${path} " PARENT_SCOPE)
303302 endfunction ()
304303endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
305304
@@ -334,12 +333,19 @@ if(SWIG_FOUND)
334333 # Add any new swig bindings here - the directory name must be the same as the binding name
335334 list (APPEND BINDINGS python ruby)
336335
336+ if (POLICY CMP0078)
337+ cmake_policy (SET CMP0078 OLD)
338+ endif ()
339+ if (POLICY CMP0086)
340+ cmake_policy (SET CMP0086 OLD)
341+ endif ()
337342 include (UseSWIG)
338343
339344 # All swig modules should include ${PROTON_HEADERS} in SWIG_MODULE_<name>_EXTRA_DEPS
340345 file (GLOB PROTON_HEADERS "${CMAKE_SOURCE_DIR} /c/include/proton/*.h" )
341- # All swig modules should include ${BINDING_DEPS} in swig_link_libraries
342- set (BINDING_DEPS qpid-proton)
346+ # All swig modules should include ${BINDING_DEPS} or ${BINDING_DEPS_FULL} in swig_link_libraries
347+ set (BINDING_DEPS qpid-proton-core)
348+ set (BINDING_DEPS_FULL qpid-proton)
343349
344350 # Add a block here to detect the prerequisites to build each language binding:
345351 #
@@ -348,15 +354,13 @@ if(SWIG_FOUND)
348354
349355 # Prerequisites for Python wrapper:
350356 find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
351- # TODO aconway 2018-09-07: get python binding tests working with sanitizers
352- if (PYTHONLIBS_FOUND AND NOT SANITIZE_FLAGS)
357+ if (PYTHONLIBS_FOUND)
353358 set (DEFAULT_PYTHON ON )
354359 endif ()
355360
356361 # Prerequisites for Ruby:
357362 find_package (Ruby)
358- # TODO aconway 2018-09-07: get ruby binding tests working with sanitizers
359- if (RUBY_FOUND AND NOT SANITIZE_FLAGS)
363+ if (RUBY_FOUND)
360364 set (DEFAULT_RUBY ON )
361365 endif ()
362366endif ()
0 commit comments