diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-09-20 17:26:09 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:06:00 -0300 |
commit | 7f5723eac1366e901391fb5771f4a70a45dc6932 (patch) | |
tree | 85ed4c047460cec62d8cc08d35ec4a811f96e1c1 /tests | |
parent | 76dae669fda417b539315b9f439128f5b29c725e (diff) |
Shiboken generator code moved to the directory generator.
Reviewer: Renato Araújo <renato.filho@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 23 | ||||
-rw-r--r-- | tests/otherbinding/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/samplebinding/CMakeLists.txt | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index dc5e52d4e..48d9de484 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,28 @@ add_subdirectory(libsample) add_subdirectory(libother) + +# Detect if the python libs were compiled in debug mode +execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\ + print sysconfig.get_config_var('Py_DEBUG')" + OUTPUT_VARIABLE PY_DEBUG + OUTPUT_STRIP_TRAILING_WHITESPACE) + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + if(NOT PYTHON_DEBUG_LIBRARIES) + message(FATAL_ERROR "Python debug library not found. Try compile shiboken with -DCMAKE_BUILD_TYPE=Release") + endif() + if(NOT PY_DEBUG) + message(WARNING "Compiling shiboken with debug enabled, but the python executable was not compiled with debug support.") + else() + add_definitions("-DPy_DEBUG") + endif() + set(SBK_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES}) +else() + set(SBK_PYTHON_LIBRARIES ${PYTHON_LIBRARIES}) + add_definitions("-DNDEBUG") +endif() + add_subdirectory(samplebinding) add_subdirectory(otherbinding) diff --git a/tests/otherbinding/CMakeLists.txt b/tests/otherbinding/CMakeLists.txt index 25294bf74..3a16dd67c 100644 --- a/tests/otherbinding/CMakeLists.txt +++ b/tests/otherbinding/CMakeLists.txt @@ -14,7 +14,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/other/other_module_wrapper.cpp ) add_custom_command(OUTPUT ${other_SRC} -COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=${shiboken_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic +COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=${generators_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic ${CMAKE_CURRENT_SOURCE_DIR}/global.h --include-paths=${libother_SOURCE_DIR}${PATH_SEP}${libsample_SOURCE_DIR}${PATH_SEP}${libsample_SOURCE_DIR}/.. --typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${sample_SOURCE_DIR} diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt index 3536ce39b..2de6deea3 100644 --- a/tests/samplebinding/CMakeLists.txt +++ b/tests/samplebinding/CMakeLists.txt @@ -77,7 +77,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/valueandvirtual_wrapper.cpp ) add_custom_command(OUTPUT ${sample_SRC} -COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=${shiboken_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic +COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=${generators_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic ${CMAKE_CURRENT_SOURCE_DIR}/global.h --include-paths=${libsample_SOURCE_DIR} --typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR} |