From 776d1cb52cbf38700d711ad4dc5d8cc127473070 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 19 Nov 2018 01:19:24 +0300 Subject: [PATCH] wscript: try to fix windres searching for game_launch, fix osx 32 bit compiling --- .travis.yml | 9 +++++---- engine/wscript | 5 +++-- game_launch/wscript | 7 +++---- mainui | 2 +- scripts/build_osx_engine.sh | 2 ++ scripts/travis_osx_deps.sh | 2 +- vgui_support/wscript | 2 +- wscript | 14 +++++++++----- 8 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 98df0a39..d22c57e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,10 +27,11 @@ git: submodules: true jdk: - oraclejdk8 -os: - - linux - - osx -# - windows +matrix: + include: + - os: linux + dist: xenial + - os: osx before_script: - sh scripts/travis_common_deps.sh - sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh diff --git a/engine/wscript b/engine/wscript index 87c439a7..b0d53a74 100644 --- a/engine/wscript +++ b/engine/wscript @@ -55,6 +55,7 @@ def configure(conf): conf.check( lib='gdi32' ) conf.check( lib='advapi32' ) conf.check( lib='dbghelp' ) + conf.check( lib='psapi' ) conf.env.append_unique('DEFINES', 'DBGHELP') def get_subproject_name(ctx): @@ -74,10 +75,10 @@ def build(bld): # basic build: dedicated only, no dependencies if bld.env.DEST_OS != 'win32': - libs += [ 'DL', 'M', 'PTHREAD' ] + libs += [ 'DL' , 'M', 'PTHREAD' ] source += bld.path.ant_glob(['platform/posix/*.c']) else: - libs += ['user32', 'shell32', 'gdi32', 'advapi32', 'dbghelp'] + libs += ['USER32', 'SHELL32', 'GDI32', 'ADVAPI32', 'DBGHELP', 'PSAPI'] source += bld.path.ant_glob(['platform/win32/*.c']) if bld.env.DEST_OS == 'linux': diff --git a/game_launch/wscript b/game_launch/wscript index 1141b33b..9029ea2a 100644 --- a/game_launch/wscript +++ b/game_launch/wscript @@ -18,6 +18,7 @@ def configure(conf): # check for dedicated server build if not conf.env.DEDICATED: if conf.env.DEST_OS == 'win32': + conf.load('winres') conf.check(lib='user32') conf.check(lib='shell32') @@ -34,13 +35,11 @@ def build(bld): source = ['game.cpp'] includes = '. ../common' libs = [] - + if bld.env.DEST_OS != 'win32': libs += [ 'DL' ] else: - # compile resource on Windows - bld.load('winres') - libs += ['user32', 'shell32'] + libs += ['USER32', 'SHELL32'] source += ['game.rc'] bld( diff --git a/mainui b/mainui index 177e49ca..792072b7 160000 --- a/mainui +++ b/mainui @@ -1 +1 @@ -Subproject commit 177e49ca640a4a695df92106c211e5a47a838c8b +Subproject commit 792072b73e3b2d9d6e0da1b9521959663973c98c diff --git a/scripts/build_osx_engine.sh b/scripts/build_osx_engine.sh index 48220770..d0ff01f9 100755 --- a/scripts/build_osx_engine.sh +++ b/scripts/build_osx_engine.sh @@ -3,6 +3,8 @@ # Build engine cd $TRAVIS_BUILD_DIR +export CC="/usr/bin/clang" +export CXX="/usr/bin/clang++" export CFLAGS="-m32" export CXXFLAGS="-m32" python waf configure --sdl2=~/Library/Frameworks/SDL2.framework/ --vgui=$TRAVIS_BUILD_DIR/vgui-dev --build-type=debug diff --git a/scripts/travis_osx_deps.sh b/scripts/travis_osx_deps.sh index 8fc18681..0d3dd7b3 100755 --- a/scripts/travis_osx_deps.sh +++ b/scripts/travis_osx_deps.sh @@ -1,4 +1,4 @@ -brew install python +# brew install python curl -s https://www.libsdl.org/release/SDL2-$SDL_VERSION.dmg > SDL2.dmg hdiutil attach SDL2.dmg cd /Volumes/SDL2 diff --git a/vgui_support/wscript b/vgui_support/wscript index 6a6bb879..ae2a57f1 100644 --- a/vgui_support/wscript +++ b/vgui_support/wscript @@ -63,7 +63,7 @@ def build(bld): # basic build: dedicated only, no dependencies if bld.env.DEST_OS != 'win32': - libs = [ 'DL', 'M' ] + libs += ['DL','M'] libs.append('VGUI') diff --git a/wscript b/wscript index 9dff334c..0b12a0df 100644 --- a/wscript +++ b/wscript @@ -105,10 +105,14 @@ def configure(conf): if(conf.env.DEST_64BIT): if(not conf.options.ALLOW64): - conf.env.append_value('LINKFLAGS', ['-m32']) - conf.env.append_value('CFLAGS', ['-m32']) - conf.env.append_value('CXXFLAGS', ['-m32']) - Logs.info('NOTE: will build engine with 64-bit toolchain using -m32') + flag = '-m32' + # Think different. + if(conf.env.DEST_OS == 'darwin'): + flag = '-arch i386' + conf.env.append_value('LINKFLAGS', [flag]) + conf.env.append_value('CFLAGS', [flag]) + conf.env.append_value('CXXFLAGS', [flag]) + Logs.info('NOTE: will build engine with 64-bit toolchain using %s' % flag) else: Logs.warn('WARNING: 64-bit engine may be unstable') @@ -169,7 +173,7 @@ def configure(conf): git_version = get_git_version() conf.end_msg(git_version) conf.env.append_unique('DEFINES', 'XASH_BUILD_COMMIT="' + git_version + '"') - + for i in SUBDIRS: conf.setenv(i, conf.env) # derive new env from global one conf.env.ENVNAME = i