diff --git a/premake5.lua b/premake5.lua index 6739d6dba19..54ba63506cf 100644 --- a/premake5.lua +++ b/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. diff --git a/src/xenia/app/premake5.lua b/src/xenia/app/premake5.lua index 86fcef7581c..49cf94133c5 100644 --- a/src/xenia/app/premake5.lua +++ b/src/xenia/app/premake5.lua @@ -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 diff --git a/src/xenia/cpu/ppc/testing/premake5.lua b/src/xenia/cpu/ppc/testing/premake5.lua index bca2bb81e44..66f8bf1ba99 100644 --- a/src/xenia/cpu/ppc/testing/premake5.lua +++ b/src/xenia/cpu/ppc/testing/premake5.lua @@ -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", diff --git a/src/xenia/gpu/premake5.lua b/src/xenia/gpu/premake5.lua index 971d6ef70a1..850580ca2b0 100644 --- a/src/xenia/gpu/premake5.lua +++ b/src/xenia/gpu/premake5.lua @@ -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 diff --git a/src/xenia/gpu/vulkan/premake5.lua b/src/xenia/gpu/vulkan/premake5.lua index 90ae7c46ec2..fe51bcd2d39 100644 --- a/src/xenia/gpu/vulkan/premake5.lua +++ b/src/xenia/gpu/vulkan/premake5.lua @@ -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 diff --git a/src/xenia/hid/premake5.lua b/src/xenia/hid/premake5.lua index 4e961f62333..844a313f46d 100644 --- a/src/xenia/hid/premake5.lua +++ b/src/xenia/hid/premake5.lua @@ -53,7 +53,7 @@ project("xenia-hid-demo") "X11-xcb", }) - filter("platforms:Windows") + filter("platforms:Windows-*") links({ "xenia-hid-winkey", "xenia-hid-xinput", diff --git a/src/xenia/ui/premake5.lua b/src/xenia/ui/premake5.lua index 6aff82bec7f..8f50fd515ca 100644 --- a/src/xenia/ui/premake5.lua +++ b/src/xenia/ui/premake5.lua @@ -19,7 +19,7 @@ project("xenia-ui") -- Exports JNI functions. wholelib("On") - filter("platforms:Windows") + filter("platforms:Windows-*") links({ "dwmapi", "dxgi", diff --git a/third_party/SDL2.lua b/third_party/SDL2.lua index 972aa1aa782..2186de6b7d1 100644 --- a/third_party/SDL2.lua +++ b/third_party/SDL2.lua @@ -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", }) diff --git a/third_party/discord-rpc.lua b/third_party/discord-rpc.lua index 1f6e795f88e..ca7d0370e19 100644 --- a/third_party/discord-rpc.lua +++ b/third_party/discord-rpc.lua @@ -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" diff --git a/third_party/mspack.lua b/third_party/mspack.lua index c1d1b44a5e8..94d6a6c8127 100644 --- a/third_party/mspack.lua +++ b/third_party/mspack.lua @@ -28,7 +28,7 @@ project("mspack") "mspack/system.h", }) - filter("platforms:Windows") + filter("platforms:Windows-*") defines({ }) filter("platforms:Linux") diff --git a/third_party/snappy.lua b/third_party/snappy.lua index bf13b762e27..3e6b1009d99 100644 --- a/third_party/snappy.lua +++ b/third_party/snappy.lua @@ -18,5 +18,5 @@ project("snappy") "snappy/snappy.h", }) - filter("platforms:Windows") + filter("platforms:Windows-*") warnings("Off") -- Too many warnings. diff --git a/tools/build/scripts/platform_files.lua b/tools/build/scripts/platform_files.lua index ec1579cf0a2..332436dad2b 100644 --- a/tools/build/scripts/platform_files.lua +++ b/tools/build/scripts/platform_files.lua @@ -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", diff --git a/xenia-build b/xenia-build index 13003232374..cfd13414370 100755 --- a/xenia-build +++ b/xenia-build @@ -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':