mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-24 02:40:26 +01:00
Disable GX warnings when buildin Python modules with Microsoft Visual Studio
Python distutils add the GX flag by default but that was for very old systems and ./Lib/distutils/msvccompiler.py was removed in Python 3.12
This commit is contained in:
parent
51159c17ab
commit
6ec62d9bbf
@ -1,3 +1,10 @@
|
||||
NEW IN WAF 2.1.3
|
||||
----------------
|
||||
* Work around a race condition in mingw Python
|
||||
* Install Python artifacts under PREFIX in a similar way as waf-2.0
|
||||
* Disable GX warnings when buildin Python modules with Microsoft Visual Studio
|
||||
* Improve the build_logs (prevent log file collisions), PyQt (v6), Sphinx and Cuda examples
|
||||
|
||||
NEW IN WAF 2.1.2
|
||||
----------------
|
||||
* Work around some Python regressions
|
||||
|
@ -34,7 +34,7 @@ static struct PyModuleDef spammodule = {
|
||||
PyMODINIT_FUNC
|
||||
PyInit_spam(void)
|
||||
{
|
||||
(void) PyModule_Create(&spammodule);
|
||||
return PyModule_Create(&spammodule);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -32,7 +32,7 @@ static struct PyModuleDef embmodule = {
|
||||
PyMODINIT_FUNC
|
||||
PyInit_emb(void)
|
||||
{
|
||||
(void) PyModule_Create(&embmodule);
|
||||
return PyModule_Create(&embmodule);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -34,9 +34,11 @@ def build(bld):
|
||||
bld(features='py', source=bld.path.ant_glob('*.py'), install_from='.')
|
||||
|
||||
# example for generated python files
|
||||
target = bld.path.find_or_declare('abc.py')
|
||||
bld(rule='touch ${TGT}', source='wscript', target=target)
|
||||
bld(features='py', source=[target], install_from=target.parent)
|
||||
from waflib import Utils
|
||||
if not Utils.is_win32:
|
||||
target = bld.path.find_or_declare('abc.py')
|
||||
bld(rule='touch ${TGT}', source='wscript', target=target)
|
||||
bld(features='py', source=[target], install_from=target.parent)
|
||||
|
||||
# then a c extension module
|
||||
bld(
|
||||
|
@ -476,8 +476,8 @@ def check_python_headers(conf, features='pyembed pyext'):
|
||||
|
||||
if env.CC_NAME == "msvc":
|
||||
# From https://github.com/python/cpython/blob/main/Lib/distutils/msvccompiler.py
|
||||
env.append_value('CFLAGS_PYEXT', [ '/nologo', '/Ox', '/MD', '/W3', '/GX', '/DNDEBUG'])
|
||||
env.append_value('CXXFLAGS_PYEXT', [ '/nologo', '/Ox', '/MD', '/W3', '/GX', '/DNDEBUG'])
|
||||
env.append_value('CFLAGS_PYEXT', [ '/nologo', '/Ox', '/MD', '/W3', '/EHsc', '/DNDEBUG'])
|
||||
env.append_value('CXXFLAGS_PYEXT', [ '/nologo', '/Ox', '/MD', '/W3', '/EHsc', '/DNDEBUG'])
|
||||
env.append_value('LINKFLAGS_PYEXT', ['/DLL', '/nologo', '/INCREMENTAL:NO'])
|
||||
|
||||
# See if it compiles
|
||||
|
Loading…
Reference in New Issue
Block a user