Basic linux build.

This commit is contained in:
Ben Vanik
2015-08-01 01:30:47 -07:00
parent daaa2bce7b
commit ef374801aa
3 changed files with 40 additions and 14 deletions

View File

@@ -12,23 +12,34 @@ os:
- linux - linux
# - osx # - osx
addons: # TODO(benvanik): re-enable when clang-3.8 is whitelisted.
apt: # https://github.com/travis-ci/apt-package-whitelist/issues/474
sources: #addons:
- llvm-toolchain-precise # apt:
packages: # sources:
- clang-3.8 # - llvm-toolchain-precise
- clang-format-3.8 # packages:
# - clang-3.8
# - clang-format-3.8
git: git:
# We handle submodules ourselves in xenia-build setup. # We handle submodules ourselves in xenia-build setup.
submodules: false submodules: false
before_install:
- sudo add-apt-repository "deb http://llvm.org/apt/precise/ llvm-toolchain-precise main" -y
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt-get update -qq
install:
- sudo apt-get install clang-3.8 clang-format-3.8
before_script: before_script:
# Dump useful info.
- $CXX --version
# Prepare environment (pull dependencies, build tools). # Prepare environment (pull dependencies, build tools).
- travis_retry ./xenia-build setup - travis_retry ./xenia-build setup
# Run test suites.
script: script:
# Run linter. # Run linter.
- ./xenia-build lint --all - ./xenia-build lint --all

View File

@@ -63,12 +63,16 @@ filter("configurations:Release")
runtime("Release") runtime("Release")
linkoptions({"/NODEFAULTLIB:MSVCRTD"}) linkoptions({"/NODEFAULTLIB:MSVCRTD"})
filter("platforms:Linux")
system("linux")
toolset("clang")
buildoptions({
"-std=c++11",
})
filter("platforms:Windows") filter("platforms:Windows")
system("windows") system("windows")
toolset("msc") toolset("msc")
-- Ignores complaints about empty obj files:
linkoptions({"/ignore:4006", "/ignore:4221"})
-- Enable multiprocessor compiles (requires Minimal Rebuild to be disabled).
buildoptions({ buildoptions({
"/MP", -- Multiprocessor compilation. "/MP", -- Multiprocessor compilation.
"/wd4100", -- Unreferenced parameters are ok. "/wd4100", -- Unreferenced parameters are ok.
@@ -88,6 +92,8 @@ filter("platforms:Windows")
"_WIN64=1", "_WIN64=1",
"_AMD64=1", "_AMD64=1",
}) })
-- Ignores complaints about empty obj files:
linkoptions({"/ignore:4006", "/ignore:4221"})
links({ links({
"ntdll", "ntdll",
"wsock32", "wsock32",
@@ -133,7 +139,7 @@ solution("xenia")
uuid("931ef4b0-6170-4f7a-aaf2-0fece7632747") uuid("931ef4b0-6170-4f7a-aaf2-0fece7632747")
startproject("xenia-app") startproject("xenia-app")
configurations({"Checked", "Debug", "Release"}) configurations({"Checked", "Debug", "Release"})
platforms({"Windows"}) platforms({"Windows", "Linux"})
architecture("x86_64") architecture("x86_64")
include("src/xenia") include("src/xenia")

View File

@@ -492,9 +492,18 @@ class BaseBuildCommand(Command):
args['config'], args['config'],
] + [('/project ', target) for target in args['target']] + ] + [('/project ', target) for target in args['target']] +
pass_args, throw_on_error=False) pass_args, throw_on_error=False)
else: elif sys.platform == 'darwin':
# TODO(benvanik): other platforms. # TODO(benvanik): other platforms.
print('ERROR: don\'t know how to build on this platform.') print('ERROR: don\'t know how to build on this platform.')
else:
# TODO(benvanik): allow gcc?
os.environ['CXX'] = 'clang++-3.8'
os.environ['CC'] = 'clang-3.8'
result = shell_call([
'make',
'-Cbuild/',
'config=%s_linux' % (args['config']),
] + pass_args, throw_on_error=False)
print('') print('')
if result != 0: if result != 0:
print('ERROR: build failed with one or more errors.') print('ERROR: build failed with one or more errors.')
@@ -734,7 +743,7 @@ class NukeCommand(Command):
print('- git reset to master...') print('- git reset to master...')
shell_call([ shell_call([
'git', 'git',
'checkout', 'reset',
'--hard', '--hard',
'master', 'master',
]) ])