Enable SDL_LEAN_AND_MEAN, SDL_RENDER_DISABLED, saves about 500kb in final exe

Build several projects that arent performance critical with /Os and /O1 under msvc windows
This commit is contained in:
chss95cs@gmail.com 2022-09-29 07:26:38 -07:00
parent 7e58a3b320
commit b4c175d8a3
13 changed files with 62 additions and 2 deletions

View File

@ -119,6 +119,11 @@ project("xenia-app")
"xenia-gpu-d3d12-trace-viewer", "xenia-gpu-d3d12-trace-viewer",
"xenia-ui-window-d3d12-demo", "xenia-ui-window-d3d12-demo",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
filter("platforms:Windows") filter("platforms:Windows")
-- Only create the .user file if it doesn't already exist. -- Only create the .user file if it doesn't already exist.

View File

@ -10,6 +10,11 @@ project("xenia-cpu")
"xenia-base", "xenia-base",
"mspack", "mspack",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
includedirs({ includedirs({
project_root.."/third_party/llvm/include", project_root.."/third_party/llvm/include",
}) })

View File

@ -12,6 +12,11 @@ project("xenia-debug-ui")
"xenia-cpu", "xenia-cpu",
"xenia-ui", "xenia-ui",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
defines({ defines({
}) })
includedirs({ includedirs({

View File

@ -38,7 +38,11 @@ project("xenia-hid-demo")
resincludedirs({ resincludedirs({
project_root, project_root,
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
filter("platforms:not Android-*") filter("platforms:not Android-*")
links({ links({
"xenia-helper-sdl", "xenia-helper-sdl",

View File

@ -10,6 +10,11 @@ project("xenia-ui-d3d12")
"xenia-base", "xenia-base",
"xenia-ui", "xenia-ui",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
local_platform_files() local_platform_files()
files({ files({
"../shaders/bytecode/d3d12_5_1/*.h", "../shaders/bytecode/d3d12_5_1/*.h",

View File

@ -14,7 +14,11 @@ project("xenia-ui")
local_platform_files() local_platform_files()
removefiles({"*_demo.cc"}) removefiles({"*_demo.cc"})
removefiles({"windowed_app_main_*.cc"}) removefiles({"windowed_app_main_*.cc"})
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
filter("platforms:Android-*") filter("platforms:Android-*")
-- Exports JNI functions. -- Exports JNI functions.
wholelib("On") wholelib("On")

View File

@ -10,6 +10,11 @@ project("xenia-ui-vulkan")
"xenia-base", "xenia-base",
"xenia-ui", "xenia-ui",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
includedirs({ includedirs({
project_root.."/third_party/Vulkan-Headers/include", project_root.."/third_party/Vulkan-Headers/include",
}) })

View File

@ -11,6 +11,11 @@ project("xenia-vfs")
}) })
defines({ defines({
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
recursive_platform_files() recursive_platform_files()
removefiles({"vfs_dump.cc"}) removefiles({"vfs_dump.cc"})

View File

@ -7,6 +7,8 @@ project("SDL2")
defines({ defines({
"HAVE_LIBC", "HAVE_LIBC",
"SDL_LEAN_AND_MEAN=1",
"SDL_RENDER_DISABLED=1"
}) })
links({ links({
"setupapi.lib", "setupapi.lib",

View File

@ -11,6 +11,11 @@ project("capstone")
"CAPSTONE_USE_SYS_DYN_MEM", "CAPSTONE_USE_SYS_DYN_MEM",
"_LIB", "_LIB",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
includedirs({ includedirs({
"capstone", "capstone",
"capstone/include", "capstone/include",

5
third_party/fmt.lua vendored
View File

@ -8,6 +8,11 @@ project("fmt")
defines({ defines({
"_LIB", "_LIB",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
includedirs({ includedirs({
"fmt/include", "fmt/include",
}) })

View File

@ -10,6 +10,11 @@ project("glslang-spirv")
}) })
includedirs({ includedirs({
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
files({ files({
"glslang/SPIRV/bitutils.h", "glslang/SPIRV/bitutils.h",
"glslang/SPIRV/disassemble.cpp", "glslang/SPIRV/disassemble.cpp",

View File

@ -11,6 +11,11 @@ project("imgui")
includedirs({ includedirs({
"imgui", "imgui",
}) })
filter({"configurations:Release", "platforms:Windows"})
buildoptions({
"/Os",
"/O1"
})
files({ files({
"imgui/imconfig.h", "imgui/imconfig.h",
"imgui/imgui.cpp", "imgui/imgui.cpp",