summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-09-20 17:26:09 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-09-20 17:33:18 -0300
commit231253beff97ce9d81d63ee437b833cc73ed1142 (patch)
treef3a1bd609b7e4c97aa17133a52666379ac8eb32d /tests
parenta02e6fff64cdfcf2022c73d03d779a2584544842 (diff)
downloadshiboken-231253beff97ce9d81d63ee437b833cc73ed1142.tar.gz
shiboken-231253beff97ce9d81d63ee437b833cc73ed1142.tar.xz
shiboken-231253beff97ce9d81d63ee437b833cc73ed1142.zip
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.txt23
-rw-r--r--tests/otherbinding/CMakeLists.txt2
-rw-r--r--tests/samplebinding/CMakeLists.txt2
3 files changed, 25 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index dc5e52d4..48d9de48 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 25294bf7..3a16dd67 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 3536ce39..2de6deea 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}