aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/pythoncore
diff options
context:
space:
mode:
authorGravatar Alexey Sokolov2017-05-24 10:04:20 +0100
committerGravatar Dessa2017-05-24 11:04:20 +0200
commitf5d172c869295ef9fff2e3de524690e523dc5d42 (patch)
treea85ed69ce7bf9234729e4e99028337c1ae3c6829 /src/modules/pythoncore
parentappveyor: fix zlib VS version (diff)
downloadKVIrc-f5d172c869295ef9fff2e3de524690e523dc5d42.tar.gz
KVIrc-f5d172c869295ef9fff2e3de524690e523dc5d42.tar.bz2
KVIrc-f5d172c869295ef9fff2e3de524690e523dc5d42.zip
Build also in debug mode for windows (#2192)
* Build also in debug mode for windows See #2191 * Don't mix /Od and -O2 on windows build. -O2 comes from perl * Reindent perlcore CMakeLists * Fix debug python build on windows * Rearrange environment vars in appveyor * Try to publish pdb files too * install qts and kvirc's debug pdbs in debug config * use TARGET_PDB_FILE instead
Diffstat (limited to 'src/modules/pythoncore')
-rw-r--r--src/modules/pythoncore/kvircmodule.cpp2
-rw-r--r--src/modules/pythoncore/kvircmodule.h2
-rw-r--r--src/modules/pythoncore/libkvipythoncore.cpp2
-rw-r--r--src/modules/pythoncore/pythonheaderwrapper.h14
4 files changed, 17 insertions, 3 deletions
diff --git a/src/modules/pythoncore/kvircmodule.cpp b/src/modules/pythoncore/kvircmodule.cpp
index 235e3545a..8937b6a63 100644
--- a/src/modules/pythoncore/kvircmodule.cpp
+++ b/src/modules/pythoncore/kvircmodule.cpp
@@ -26,7 +26,7 @@
#ifdef COMPILE_PYTHON_SUPPORT
-#include <Python.h>
+#include "pythonheaderwrapper.h"
#define KVIRC_MODULE
diff --git a/src/modules/pythoncore/kvircmodule.h b/src/modules/pythoncore/kvircmodule.h
index 53376d577..53e716d7d 100644
--- a/src/modules/pythoncore/kvircmodule.h
+++ b/src/modules/pythoncore/kvircmodule.h
@@ -37,7 +37,7 @@
#ifdef COMPILE_PYTHON_SUPPORT
-#include <Python.h>
+#include "pythonheaderwrapper.h"
// python included like to pollute the global namespace, let's #undef some beef
#undef isspace
diff --git a/src/modules/pythoncore/libkvipythoncore.cpp b/src/modules/pythoncore/libkvipythoncore.cpp
index 812e414b6..90dca594d 100644
--- a/src/modules/pythoncore/libkvipythoncore.cpp
+++ b/src/modules/pythoncore/libkvipythoncore.cpp
@@ -34,7 +34,7 @@
#ifdef COMPILE_PYTHON_SUPPORT
#include "pythoncoreinterface.h"
-#include <Python.h>
+#include "pythonheaderwrapper.h"
KviKvsRunTimeContext * g_pCurrentKvsContext = nullptr;
bool g_bExecuteQuiet = false;
diff --git a/src/modules/pythoncore/pythonheaderwrapper.h b/src/modules/pythoncore/pythonheaderwrapper.h
new file mode 100644
index 000000000..47f60d361
--- /dev/null
+++ b/src/modules/pythoncore/pythonheaderwrapper.h
@@ -0,0 +1,14 @@
+#ifndef _PYTHONHEADERWRAPPER_H_
+#define _PYTHONHEADERWRAPPER_H_
+
+// See http://stackoverflow.com/questions/16200997/why-doesnt-include-python-h-work and http://stackoverflow.com/questions/19716859/puzzling-dependency-of-boost-python-1-54-debug-build-to-python27-lib-on-window
+
+#if defined(_DEBUG) && defined(_MSC_VER)
+# undef _DEBUG
+# include <Python.h>
+# define _DEBUG 1
+#else
+# include <Python.h>
+#endif
+
+#endif