Skip to content

Commit

Permalink
Get rid of gflags alltogether
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoyvaerts committed May 8, 2019
1 parent 7ea4083 commit 8087ab0
Show file tree
Hide file tree
Showing 30 changed files with 2 additions and 163 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
[submodule "third_party/catch"]
path = third_party/catch
url = https://github.com/catchorg/Catch2.git
[submodule "third_party/gflags"]
path = third_party/gflags
url = https://github.com/benvanik/gflags.git
[submodule "third_party/premake-core"]
path = third_party/premake-core
url = https://github.com/xenia-project/premake-core.git
Expand Down
24 changes: 1 addition & 23 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,9 @@ filter("platforms:Windows")
"shlwapi",
})

-- Create scratch/ path and dummy flags file if needed.
-- Create scratch/ path
if not os.isdir("scratch") then
os.mkdir("scratch")
local flags_file = io.open("scratch/flags.txt", "w")
flags_file:write("# Put flags, one on each line.\n")
flags_file:write("# Launch executables with --flags_file=scratch/flags.txt\n")
flags_file:write("\n")
flags_file:write("--cpu=x64\n")
flags_file:write("#--enable_haswell_instructions=false\n")
flags_file:write("\n")
flags_file:write("--debug\n")
flags_file:write("#--protect_zero=false\n")
flags_file:write("\n")
flags_file:write("#--mute\n")
flags_file:write("\n")
flags_file:write("--fast_stdout\n")
flags_file:write("#--flush_stdout=false\n")
flags_file:write("\n")
flags_file:write("#--vsync=false\n")
flags_file:write("#--trace_gpu_prefix=scratch/gpu/gpu_trace_\n")
flags_file:write("#--trace_gpu_stream\n")
flags_file:write("#--disable_framebuffer_readback\n")
flags_file:write("\n")
flags_file:close()
end

solution("xenia")
Expand All @@ -229,7 +208,6 @@ solution("xenia")
include("third_party/capstone.lua")
include("third_party/cpptoml.lua")
include("third_party/cxxopts.lua")
include("third_party/gflags.lua")
include("third_party/glew.lua")
include("third_party/glslang-spirv.lua")
include("third_party/imgui.lua")
Expand Down
5 changes: 0 additions & 5 deletions src/xenia/app/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ project("xenia-app")
links({
"aes_128",
"capstone",
"gflags",
"glew",
"glslang-spirv",
"imgui",
Expand Down Expand Up @@ -43,9 +42,6 @@ project("xenia-app")
"XBYAK_NO_OP_NAMES",
"XBYAK_ENABLE_OMITTED_OPERAND",
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
files({
"xenia_main.cc",
Expand Down Expand Up @@ -87,6 +83,5 @@ project("xenia-app")
if not os.isfile(user_file) then
debugdir(project_root)
debugargs({
"--flagfile=scratch/flags.txt",
})
end
3 changes: 0 additions & 3 deletions src/xenia/apu/nop/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ project("xenia-apu-nop")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
1 change: 0 additions & 1 deletion src/xenia/apu/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ project("xenia-apu")
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
project_root.."/third_party/libav/",
})
local_platform_files()
3 changes: 0 additions & 3 deletions src/xenia/apu/xaudio2/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ project("xenia-apu-xaudio2")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
3 changes: 1 addition & 2 deletions src/xenia/base/main_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ int Main() {
auto entry_info = xe::GetEntryInfo();

// Convert command line to an argv-like format so we can share code/use
// gflags.
auto command_line = GetCommandLineW();
int argc;
wchar_t** argv = CommandLineToArgvW(command_line, &argc);
if (!argv) {
return 1;
}

// Convert all args to narrow, as gflags doesn't support wchar.
// Convert all args to narrow, as cxxopts doesn't support wchar.
int argca = argc;
char** argva = reinterpret_cast<char**>(alloca(sizeof(char*) * argca));
for (int n = 0; n < argca; n++) {
Expand Down
3 changes: 0 additions & 3 deletions src/xenia/base/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ project("xenia-base")
language("C++")
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
removefiles({"main_*.cc"})
files({
Expand Down
3 changes: 0 additions & 3 deletions src/xenia/base/testing/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ project_root = "../../../.."
include(project_root.."/tools/build")

test_suite("xenia-base-tests", project_root, ".", {
includedirs = {
project_root.."/third_party/gflags/src",
},
links = {
"xenia-base",
},
Expand Down
1 change: 0 additions & 1 deletion src/xenia/cpu/backend/x64/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ project("xenia-cpu-backend-x64")

includedirs({
project_root.."/third_party/capstone/include",
project_root.."/third_party/gflags/src",
})
local_platform_files()
9 changes: 0 additions & 9 deletions src/xenia/cpu/ppc/testing/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ project("xenia-cpu-ppc-tests")
"xenia-cpu-backend-x64",
"xenia-cpu",
"xenia-base",
"gflags",
"capstone", -- cpu-backend-x64
"mspack",
})
Expand All @@ -22,15 +21,11 @@ project("xenia-cpu-ppc-tests")
files({
"*.s",
})
includedirs({
project_root.."/third_party/gflags/src",
})
filter("files:*.s")
flags({"ExcludeFromBuild"})
filter("platforms:Windows")
debugdir(project_root)
debugargs({
"--flagfile=scratch/flags.txt",
"2>&1",
"1>scratch/stdout-testing.txt",
})
Expand All @@ -46,7 +41,6 @@ project("xenia-cpu-ppc-nativetests")
language("C++")
links({
"xenia-base",
"gflags",
})
files({
"ppc_testing_native_main.cc",
Expand All @@ -59,9 +53,6 @@ project("xenia-cpu-ppc-nativetests")
filter("files:instr_*.s", "files:seq_*.s")
flags({"ExcludeFromBuild"})
filter({})
includedirs({
project_root.."/third_party/gflags/src",
})
buildoptions({
"-Wa,-mregnames", -- Tell GAS to accept register names.
})
Expand Down
1 change: 0 additions & 1 deletion src/xenia/cpu/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ project("xenia-cpu")
})
includedirs({
project_root.."/third_party/llvm/include",
project_root.."/third_party/gflags/src",
})
local_platform_files()
local_platform_files("backend")
Expand Down
3 changes: 0 additions & 3 deletions src/xenia/cpu/testing/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ project_root = "../../../.."
include(project_root.."/tools/build")

test_suite("xenia-cpu-tests", project_root, ".", {
includedirs = {
project_root.."/third_party/gflags/src",
},
links = {
"capstone",
"xenia-base",
Expand Down
1 change: 0 additions & 1 deletion src/xenia/debug/ui/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ project("xenia-debug-ui")
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
project_root.."/third_party/yaml-cpp/include/",
})
local_platform_files()
3 changes: 0 additions & 3 deletions src/xenia/gpu/null/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ project("xenia-gpu-null")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
6 changes: 0 additions & 6 deletions src/xenia/gpu/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ project("xenia-gpu")
})
includedirs({
project_root.."/third_party/spirv-tools/external/include",
project_root.."/third_party/gflags/src",
})
local_platform_files()
-- local_platform_files("spirv")
Expand All @@ -31,7 +30,6 @@ project("xenia-gpu-shader-compiler")
kind("ConsoleApp")
language("C++")
links({
"gflags",
"glslang-spirv",
"spirv-tools",
"xenia-base",
Expand All @@ -40,9 +38,6 @@ project("xenia-gpu-shader-compiler")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
files({
"shader_compiler_main.cc",
"../base/main_"..platform_suffix..".cc",
Expand All @@ -54,7 +49,6 @@ project("xenia-gpu-shader-compiler")
if not os.isfile(user_file) then
debugdir(project_root)
debugargs({
"--flagfile=scratch/flags.txt",
"2>&1",
"1>scratch/stdout-shader-compiler.txt",
})
Expand Down
13 changes: 0 additions & 13 deletions src/xenia/gpu/vulkan/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ project("xenia-gpu-vulkan")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
files({
"shaders/bin/*.h",
Expand All @@ -34,7 +31,6 @@ project("xenia-gpu-vulkan-trace-viewer")
links({
"aes_128",
"capstone",
"gflags",
"glslang-spirv",
"imgui",
"libavcodec",
Expand Down Expand Up @@ -62,9 +58,6 @@ project("xenia-gpu-vulkan-trace-viewer")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
files({
"vulkan_trace_viewer_main.cc",
"../../base/main_"..platform_suffix..".cc",
Expand All @@ -91,7 +84,6 @@ project("xenia-gpu-vulkan-trace-viewer")
if not os.isfile(user_file) then
debugdir(project_root)
debugargs({
"--flagfile=scratch/flags.txt",
"2>&1",
"1>scratch/stdout-trace-viewer.txt",
})
Expand All @@ -105,7 +97,6 @@ project("xenia-gpu-vulkan-trace-dump")
links({
"aes_128",
"capstone",
"gflags",
"glslang-spirv",
"imgui",
"libavcodec",
Expand Down Expand Up @@ -133,9 +124,6 @@ project("xenia-gpu-vulkan-trace-dump")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
files({
"vulkan_trace_dump_main.cc",
"../../base/main_"..platform_suffix..".cc",
Expand All @@ -156,7 +144,6 @@ project("xenia-gpu-vulkan-trace-dump")
if not os.isfile(user_file) then
debugdir(project_root)
debugargs({
"--flagfile=scratch/flags.txt",
"2>&1",
"1>scratch/stdout-trace-dump.txt",
})
Expand Down
3 changes: 0 additions & 3 deletions src/xenia/hid/nop/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ project("xenia-hid-nop")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
7 changes: 0 additions & 7 deletions src/xenia/hid/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ project("xenia-hid")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
removefiles({"*_demo.cc"})

Expand All @@ -23,7 +20,6 @@ project("xenia-hid-demo")
kind("WindowedApp")
language("C++")
links({
"gflags",
"glew",
"imgui",
"volk",
Expand All @@ -37,9 +33,6 @@ project("xenia-hid-demo")
"GLEW_STATIC=1",
"GLEW_MX=1",
})
includedirs({
project_root.."/third_party/gflags/src",
})
files({
"hid_demo.cc",
"../base/main_"..platform_suffix..".cc",
Expand Down
3 changes: 0 additions & 3 deletions src/xenia/hid/winkey/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@ project("xenia-hid-winkey")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
3 changes: 0 additions & 3 deletions src/xenia/hid/xinput/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ project("xenia-hid-xinput")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
3 changes: 0 additions & 3 deletions src/xenia/kernel/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ project("xenia-kernel")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
recursive_platform_files()
files({
"debug_visualizers.natvis",
Expand Down
3 changes: 0 additions & 3 deletions src/xenia/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ project("xenia-core")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
files({"*.h", "*.cc"})
3 changes: 0 additions & 3 deletions src/xenia/ui/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ project("xenia-ui")
})
defines({
})
includedirs({
project_root.."/third_party/gflags/src",
})
local_platform_files()
removefiles({"*_demo.cc"})
Loading

0 comments on commit 8087ab0

Please sign in to comment.