aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-06-21 14:10:10 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-06-21 17:45:05 -0300
commit86d0f6715ed282f7fecf789a85feb03d913ea7d9 (patch)
tree9abbe0f8b329d8e82de7215224d0272f46b0deba /CMakeLists.txt
parent54b69c3595cadfbfa5f65849d4dd106718920976 (diff)
Fix bug: "Debug build fails to run the tests (doesn't work) [_Py_AddToAllObjects: Assertion (...) failed]"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0461bf30..3d5709520 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,6 +126,16 @@ if (NOT SITE_PACKAGE)
endif()
endif()
+# 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 (PY_DEBUG)
+ add_definitions("-DPy_DEBUG")
+endif()
+
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
enable_testing()