[Build] Add Windows ARM64 support
Separates the `Windows` platform into `Windows-x86_64` and `Windows-ARM64`. Adds `--arch` argument to `build`. Removes x64 backend on non-x64 targets.
This commit is contained in:
parent
f6b5424a9f
commit
17461771ae
25
premake5.lua
25
premake5.lua
|
@ -54,7 +54,7 @@ filter("configurations:Checked")
|
|||
defines({
|
||||
"DEBUG",
|
||||
})
|
||||
filter({"configurations:Checked", "platforms:Windows"})
|
||||
filter({"configurations:Checked", "platforms:Windows-*"})
|
||||
buildoptions({
|
||||
"/RTCsu", -- Full Run-Time Checks.
|
||||
})
|
||||
|
@ -153,7 +153,7 @@ filter("platforms:Android-*")
|
|||
"log",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
system("windows")
|
||||
toolset("msc")
|
||||
buildoptions({
|
||||
|
@ -179,8 +179,12 @@ filter("platforms:Windows")
|
|||
"_CRT_SECURE_NO_WARNINGS",
|
||||
"WIN32",
|
||||
"_WIN64=1",
|
||||
"_AMD64=1",
|
||||
})
|
||||
filter("architecture:x86_64")
|
||||
defines({
|
||||
"_AMD64=1",
|
||||
})
|
||||
filter({})
|
||||
linkoptions({
|
||||
"/ignore:4006", -- Ignores complaints about empty obj files.
|
||||
"/ignore:4221",
|
||||
|
@ -198,7 +202,7 @@ filter("platforms:Windows")
|
|||
})
|
||||
|
||||
-- Embed the manifest for things like dependencies and DPI awareness.
|
||||
filter({"platforms:Windows", "kind:ConsoleApp or WindowedApp"})
|
||||
filter({"platforms:Windows-*", "kind:ConsoleApp or WindowedApp"})
|
||||
files({
|
||||
"src/xenia/base/app_win32.manifest"
|
||||
})
|
||||
|
@ -228,7 +232,12 @@ workspace("xenia")
|
|||
["ARCHS"] = "x86_64"
|
||||
})
|
||||
elseif os.istarget("windows") then
|
||||
platforms({"Windows"})
|
||||
platforms({"Windows-ARM64", "Windows-x86_64"})
|
||||
filter("platforms:Windows-ARM64")
|
||||
architecture("ARM64")
|
||||
filter("platforms:Windows-x86_64")
|
||||
architecture("x86_64")
|
||||
filter({})
|
||||
-- 10.0.15063.0: ID3D12GraphicsCommandList1::SetSamplePositions.
|
||||
-- 10.0.19041.0: D3D12_HEAP_FLAG_CREATE_NOT_ZEROED.
|
||||
-- 10.0.22000.0: DWMWA_WINDOW_CORNER_PREFERENCE.
|
||||
|
@ -284,7 +293,11 @@ workspace("xenia")
|
|||
include("src/xenia/apu/nop")
|
||||
include("src/xenia/base")
|
||||
include("src/xenia/cpu")
|
||||
include("src/xenia/cpu/backend/x64")
|
||||
|
||||
filter("architecture:x86_64")
|
||||
include("src/xenia/cpu/backend/x64")
|
||||
filter({})
|
||||
|
||||
include("src/xenia/debug/ui")
|
||||
include("src/xenia/gpu")
|
||||
include("src/xenia/gpu/null")
|
||||
|
|
|
@ -78,7 +78,7 @@ project("xenia-app")
|
|||
"xenia_main.cc",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
files({
|
||||
"main_resources.rc",
|
||||
})
|
||||
|
@ -104,7 +104,7 @@ project("xenia-app")
|
|||
"SDL2",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
links({
|
||||
"xenia-apu-xaudio2",
|
||||
"xenia-gpu-d3d12",
|
||||
|
@ -113,13 +113,13 @@ project("xenia-app")
|
|||
"xenia-ui-d3d12",
|
||||
})
|
||||
|
||||
filter({"platforms:Windows", SINGLE_LIBRARY_FILTER})
|
||||
filter({"platforms:Windows-*", SINGLE_LIBRARY_FILTER})
|
||||
links({
|
||||
"xenia-gpu-d3d12-trace-viewer",
|
||||
"xenia-ui-window-d3d12-demo",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
-- Only create the .user file if it doesn't already exist.
|
||||
local user_file = project_root.."/build/xenia-app.vcxproj.user"
|
||||
if not os.isfile(user_file) then
|
||||
|
|
|
@ -27,7 +27,7 @@ project("xenia-cpu-ppc-tests")
|
|||
links({
|
||||
"xenia-cpu-backend-x64",
|
||||
})
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
debugdir(project_root)
|
||||
debugargs({
|
||||
"2>&1",
|
||||
|
|
|
@ -43,7 +43,7 @@ project("xenia-gpu-shader-compiler")
|
|||
"../base/console_app_main_"..platform_suffix..".cc",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
-- Only create the .user file if it doesn't already exist.
|
||||
local user_file = project_root.."/build/xenia-gpu-shader-compiler.vcxproj.user"
|
||||
if not os.isfile(user_file) then
|
||||
|
|
|
@ -75,7 +75,7 @@ project("xenia-gpu-vulkan-trace-viewer")
|
|||
"X11-xcb",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
-- Only create the .user file if it doesn't already exist.
|
||||
local user_file = project_root.."/build/xenia-gpu-vulkan-trace-viewer.vcxproj.user"
|
||||
if not os.isfile(user_file) then
|
||||
|
@ -138,7 +138,7 @@ project("xenia-gpu-vulkan-trace-dump")
|
|||
"X11-xcb",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
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"
|
||||
if not os.isfile(user_file) then
|
||||
|
|
|
@ -53,7 +53,7 @@ project("xenia-hid-demo")
|
|||
"X11-xcb",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
links({
|
||||
"xenia-hid-winkey",
|
||||
"xenia-hid-xinput",
|
||||
|
|
|
@ -19,7 +19,7 @@ project("xenia-ui")
|
|||
-- Exports JNI functions.
|
||||
wholelib("On")
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
links({
|
||||
"dwmapi",
|
||||
"dxgi",
|
||||
|
|
|
@ -26,7 +26,7 @@ end
|
|||
-- Call this function in project scope to include the SDL2 headers.
|
||||
--
|
||||
function sdl2_include()
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
includedirs({
|
||||
path.getrelative(".", third_party_path) .. "/SDL2/include",
|
||||
})
|
||||
|
|
|
@ -30,7 +30,7 @@ project("discord-rpc")
|
|||
files({
|
||||
"discord-rpc/src/discord_register_osx.m"
|
||||
})
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
files({
|
||||
"discord-rpc/src/connection_win.cpp",
|
||||
"discord-rpc/src/discord_register_win.cpp"
|
||||
|
|
|
@ -28,7 +28,7 @@ project("mspack")
|
|||
"mspack/system.h",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
defines({
|
||||
})
|
||||
filter("platforms:Linux")
|
||||
|
|
|
@ -18,5 +18,5 @@ project("snappy")
|
|||
"snappy/snappy.h",
|
||||
})
|
||||
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
warnings("Off") -- Too many warnings.
|
||||
|
|
|
@ -20,7 +20,7 @@ local function match_platform_files(base_path, base_match)
|
|||
removefiles({base_path.."/".."**_android.h", base_path.."/".."**_android.cc"})
|
||||
removefiles({base_path.."/".."**_mac.h", base_path.."/".."**_mac.cc"})
|
||||
removefiles({base_path.."/".."**_win.h", base_path.."/".."**_win.cc"})
|
||||
filter("platforms:Windows")
|
||||
filter("platforms:Windows-*")
|
||||
files({
|
||||
base_path.."/"..base_match.."_win.h",
|
||||
base_path.."/"..base_match.."_win.cc",
|
||||
|
|
|
@ -781,6 +781,8 @@ class BaseBuildCommand(Command):
|
|||
self.parser.add_argument(
|
||||
'--target', action='append', default=[],
|
||||
help='Builds only the given target(s).')
|
||||
self.parser.add_argument(
|
||||
'--arch', default='x86_64', help='Builds only the given architecture')
|
||||
self.parser.add_argument(
|
||||
'--force', action='store_true',
|
||||
help='Forces a full rebuild.')
|
||||
|
@ -823,6 +825,7 @@ class BaseBuildCommand(Command):
|
|||
'/m',
|
||||
'/v:m',
|
||||
'/p:Configuration=' + args['config'],
|
||||
'/p:Platform=' + "Windows-" + args['arch'],
|
||||
] + ([targets] if targets is not None else []) + pass_args,
|
||||
shell=False)
|
||||
elif sys.platform == 'darwin':
|
||||
|
|
Loading…
Reference in New Issue