Browse Source

waf: fix multiprocess compilation with msvc

pull/2/head
Alibek Omarov 5 years ago
parent
commit
b1406e8ecd
  1. 2
      scripts/build_windows_engine.sh
  2. 10
      scripts/waifulib/msvcfix.py
  3. 2
      wscript

2
scripts/build_windows_engine.sh

@ -8,7 +8,7 @@ cd $TRAVIS_BUILD_DIR @@ -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

10
scripts/waifulib/msvcfix.py

@ -0,0 +1,10 @@ @@ -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)

2
wscript

@ -89,7 +89,7 @@ def configure(conf): @@ -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

Loading…
Cancel
Save