waf: fix multiprocess compilation with msvc

This commit is contained in:
Alibek Omarov 2019-06-26 16:41:58 +03:00
parent 76a8fe4873
commit b1406e8ecd
3 changed files with 12 additions and 2 deletions

View File

@ -8,7 +8,7 @@ cd $TRAVIS_BUILD_DIR
# NOTE: to build with other version use --msvc_version during configuration
# NOTE: sometimes you may need to add WinSDK to %PATH%
./waf.bat configure -s "$TRAVIS_BUILD_DIR/SDL2_VC" -T "debug" --prefix=`pwd` || die
./waf.bat build -j1 || die
./waf.bat build || die
echo After build
./waf.bat install || die

View File

@ -0,0 +1,10 @@
#!/usr/bin/env
from waflib.TaskGen import feature, after_method
@feature('c', 'cxx')
@after_method('apply_flags_msvc')
def make_pdb_unique(self):
for t in self.compiled_tasks:
pdb_unique_cflag = '/Fd' + t.outputs[0].change_ext('.pdb').abspath()
t.env.append_value('CFLAGS', pdb_unique_cflag)
t.env.append_value('CXXFLAGS', pdb_unique_cflag)

View File

@ -89,7 +89,7 @@ def configure(conf):
conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01'
conf.env.MSVC_TARGETS = ['x86'] # explicitly request x86 target for MSVC
if sys.platform == 'win32':
conf.load('msvc msdev msvs')
conf.load('msvc msvcfix msdev msvs')
conf.load('xcompile compiler_c compiler_cxx gitversion clang_compilation_database')
# Every static library must have fPIC