Fixup 360 support

This commit is contained in:
DrChat 2018-04-03 19:02:49 -05:00
parent 6b8a34c9ba
commit 14abe1a407
7 changed files with 68 additions and 26 deletions

View File

@ -28,9 +28,11 @@ defines({
})
-- TODO(DrChat): Find a way to disable this on other architectures.
filter("architecture:x86_64")
vectorextensions("AVX")
filter({})
if ARCH ~= "ppc64" then
filter("architecture:x86_64")
vectorextensions("AVX")
filter({})
end
characterset("Unicode")
flags({
@ -95,13 +97,6 @@ filter("platforms:Linux")
"dl",
"lz4",
"rt",
"X11",
"xcb",
"X11-xcb",
"GL",
"vulkan",
"c++",
"c++abi"
})
linkoptions({
"`pkg-config --libs gtk+-3.0`",
@ -110,19 +105,31 @@ filter("platforms:Linux")
filter({"platforms:Linux", "kind:*App"})
linkgroups("On")
filter({"platforms:Linux", "language:C++", "toolset:gcc"})
filter({"platforms:Linux", "toolset:gcc"})
buildoptions({
"--std=c++11",
"-std=c++14",
})
links({
})
if ARCH == "ppc64" then
buildoptions({
"-m32",
"-mpowerpc64"
})
linkoptions({
"-m32",
"-mpowerpc64"
})
end
filter({"platforms:Linux", "language:C++", "toolset:clang"})
filter({"platforms:Linux", "toolset:clang"})
buildoptions({
"-std=c++14",
"-stdlib=libstdc++",
})
links({
"c++",
"c++abi"
})
disablewarnings({
"deprecated-register"

View File

@ -60,6 +60,15 @@ project("xenia-app")
project_root,
})
filter("platforms:Linux")
links({
"X11",
"xcb",
"X11-xcb",
"GL",
"vulkan",
})
filter("platforms:Windows")
links({
"xenia-apu-xaudio2",

View File

@ -13,6 +13,7 @@
// NOTE: if you're including this file it means you are explicitly depending
// on Linux headers. Including this file outside of linux platform specific
// source code will break portability
#include <cstddef>
#include "xenia/base/platform.h"

View File

@ -189,7 +189,7 @@ class TestRunner {
~TestRunner() {
memory::DeallocFixed(memory_, memory_size_,
memory::DeallocationType::kDecommitRelease);
memory::DeallocationType::kRelease);
memory::AlignedFree(context_);
}

View File

@ -68,6 +68,15 @@ project("xenia-gpu-gl4-trace-viewer")
"../../base/main_"..platform_suffix..".cc",
})
filter("platforms:Linux")
links({
"X11",
"xcb",
"X11-xcb",
"GL",
"vulkan",
})
filter("platforms:Windows")
links({
"xenia-apu-xaudio2",

View File

@ -71,6 +71,15 @@ project("xenia-gpu-vulkan-trace-viewer")
"../../base/main_"..platform_suffix..".cc",
})
filter("platforms:Linux")
links({
"X11",
"xcb",
"X11-xcb",
"GL",
"vulkan",
})
filter("platforms:Windows")
links({
"xenia-apu-xaudio2",
@ -131,6 +140,15 @@ project("xenia-gpu-vulkan-trace-dump")
"../../base/main_"..platform_suffix..".cc",
})
filter("platforms:Linux")
links({
"X11",
"xcb",
"X11-xcb",
"GL",
"vulkan",
})
filter("platforms:Windows")
-- Only create the .user file if it doesn't already exist.
local user_file = project_root.."/build/xenia-gpu-vulkan-trace-dump.vcxproj.user"

View File

@ -310,7 +310,7 @@ def get_clang_format_binary():
sys.exit(1)
def run_premake(target_os, action):
def run_premake(target_os, action, cc=None):
"""Runs premake on the main project with the given format.
Args:
@ -322,7 +322,7 @@ def run_premake(target_os, action):
os.path.join('tools', 'build', 'premake'),
'--file=premake5.lua',
'--os=%s' % target_os,
'--cc=clang',
'--cc=%s' % ('clang' if not cc else cc),
'--test-suite-mode=combined',
'--verbose',
action,
@ -344,7 +344,7 @@ def run_premake_clean():
return run_premake('linux', 'clean')
def run_platform_premake():
def run_platform_premake(cc=None):
"""Runs all gyp configurations.
"""
if sys.platform == 'darwin':
@ -356,7 +356,7 @@ def run_platform_premake():
return run_premake('windows', 'vs' + vs_version)
else:
ret = run_premake('linux', 'gmake')
ret = run_premake('linux', 'gmake', cc)
ret = ret != 0 and run_premake('linux', 'codelite') or ret
return ret
@ -546,12 +546,14 @@ class PremakeCommand(Command):
name='premake',
help_short='Runs premake to update all projects.',
*args, **kwargs)
self.parser.add_argument(
'--cc', default='clang', help='Compiler toolchain passed to premake')
def execute(self, args, pass_args, cwd):
# Update premake. If no binary found, it will be built from source.
print('Running premake...')
print('')
if run_platform_premake() == 0:
if run_platform_premake(args['cc']) == 0:
print('Success!')
return 0
@ -564,6 +566,8 @@ class BaseBuildCommand(Command):
super(BaseBuildCommand, self).__init__(
subparsers,
*args, **kwargs)
self.parser.add_argument(
'--cc', default='clang', help='Compiler toolchain passed to premake')
self.parser.add_argument(
'--config', choices=['checked', 'debug', 'release'], default='debug',
type=str.lower, help='Chooses the build configuration.')
@ -582,7 +586,7 @@ class BaseBuildCommand(Command):
def execute(self, args, pass_args, cwd):
if not args['no_premake']:
print('- running premake...')
run_platform_premake()
run_platform_premake(args['cc'])
print('')
threads = args['j']
@ -613,12 +617,6 @@ class BaseBuildCommand(Command):
print('ERROR: don\'t know how to build on this platform.')
result = 1
else:
# TODO(benvanik): allow gcc?
if 'CXX' not in os.environ:
os.environ['CXX'] = 'clang++-3.8'
if 'CC' not in os.environ:
os.environ['CC'] = 'clang-3.8'
result = subprocess.call([
'make',
'-j' if threads is 0 else '-j%d' % threads,