Browse Source

wscript: try to fix windres searching for game_launch, fix osx 32 bit compiling

pull/2/head
Alibek Omarov 6 years ago
parent
commit
776d1cb52c
  1. 9
      .travis.yml
  2. 5
      engine/wscript
  3. 7
      game_launch/wscript
  4. 2
      mainui
  5. 2
      scripts/build_osx_engine.sh
  6. 2
      scripts/travis_osx_deps.sh
  7. 2
      vgui_support/wscript
  8. 14
      wscript

9
.travis.yml

@ -27,10 +27,11 @@ git: @@ -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

5
engine/wscript

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

7
game_launch/wscript

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

2
mainui

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 177e49ca640a4a695df92106c211e5a47a838c8b
Subproject commit 792072b73e3b2d9d6e0da1b9521959663973c98c

2
scripts/build_osx_engine.sh

@ -3,6 +3,8 @@ @@ -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

2
scripts/travis_osx_deps.sh

@ -1,4 +1,4 @@ @@ -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

2
vgui_support/wscript

@ -63,7 +63,7 @@ def build(bld): @@ -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')

14
wscript

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

Loading…
Cancel
Save