@@ -37,9 +37,10 @@ find_package (SWIG)
37
37
find_package (CyrusSASL)
38
38
39
39
enable_testing ()
40
+ include (tests/PNAddTest.cmake)
40
41
41
42
# Set up runtime checks (valgrind, sanitizers etc.)
42
- include (tests/RuntimeCheck.cmake)
43
+ include (tests/RuntimeCheck.cmake)
43
44
44
45
## Variables used across components
45
46
@@ -76,7 +77,7 @@ else (CMAKE_CONFIGURATION_TYPES)
76
77
# There is a single build configuration
77
78
# If the build type is not set then set the default
78
79
if (NOT CMAKE_BUILD_TYPE )
79
- set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE string
80
+ set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
80
81
"Build type: Debug, Release, RelWithDebInfo, MinSizeRel or Coverage (default RelWithDebInfo)" FORCE)
81
82
endif ()
82
83
@@ -113,12 +114,8 @@ endif()
113
114
# off if building there:
114
115
if (APPLE )
115
116
set (NOENABLE_WARNING_ERROR ON )
116
- set (NOENABLE_UNDEFINED_ERROR ON )
117
117
endif (APPLE )
118
118
119
- # Make LTO default to off until we can figure out the valgrind issues
120
- set (NOENABLE_LINKTIME_OPTIMIZATION ON )
121
-
122
119
# Add options here called <whatever> they will turn into "ENABLE_<whatever" and can be
123
120
# overridden on a platform specific basis above by NOENABLE_<whatever>
124
121
set (OPTIONS WARNING_ERROR UNDEFINED_ERROR LINKTIME_OPTIMIZATION HIDE_UNEXPORTED_SYMBOLS FUZZ_TESTING)
@@ -275,7 +272,7 @@ foreach (LANG ${BINDING_LANGS})
275
272
endif ()
276
273
endforeach ()
277
274
278
- set (PROTON_SHARE ${SHARE_INSTALL_DIR} /proton- ${PN_VERSION} )
275
+ set (PROTON_SHARE ${SHARE_INSTALL_DIR} /proton)
279
276
# End of variables used during install
280
277
281
278
# Set result to a native search path - used by examples and binding tests.
@@ -289,17 +286,19 @@ macro(set_search_path result)
289
286
endmacro ()
290
287
291
288
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
292
- # No change needed for windows already use correct separator
289
+ # CMake uses semicolon as list separator. Change ';'->'\;'
293
290
function (to_native_path path result)
294
291
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)
296
295
endfunction ()
297
296
else (CMAKE_SYSTEM_NAME STREQUAL Windows)
298
297
# Just change ';'->':'
299
298
function (to_native_path path result)
300
299
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)
303
302
endfunction ()
304
303
endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
305
304
@@ -334,12 +333,19 @@ if(SWIG_FOUND)
334
333
# Add any new swig bindings here - the directory name must be the same as the binding name
335
334
list (APPEND BINDINGS python ruby)
336
335
336
+ if (POLICY CMP0078)
337
+ cmake_policy (SET CMP0078 OLD)
338
+ endif ()
339
+ if (POLICY CMP0086)
340
+ cmake_policy (SET CMP0086 OLD)
341
+ endif ()
337
342
include (UseSWIG)
338
343
339
344
# All swig modules should include ${PROTON_HEADERS} in SWIG_MODULE_<name>_EXTRA_DEPS
340
345
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)
343
349
344
350
# Add a block here to detect the prerequisites to build each language binding:
345
351
#
@@ -348,15 +354,13 @@ if(SWIG_FOUND)
348
354
349
355
# Prerequisites for Python wrapper:
350
356
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)
353
358
set (DEFAULT_PYTHON ON )
354
359
endif ()
355
360
356
361
# Prerequisites for Ruby:
357
362
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)
360
364
set (DEFAULT_RUBY ON )
361
365
endif ()
362
366
endif ()
0 commit comments