From 8770e6e6cf14d0e812761789beaee34429f2c843 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Fri, 1 Jan 2016 12:13:36 -0800 Subject: [PATCH] Adding yaml-cpp for #428, use rando fork until jbeder/yaml-cpp#342 lands. --- .gitmodules | 3 +++ premake5.lua | 1 + src/xenia/debug/ui/debug_window.cc | 1 + src/xenia/debug/ui/premake5.lua | 2 ++ src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc | 2 +- third_party/yaml-cpp | 1 + third_party/yaml-cpp.lua | 17 +++++++++++++++++ tools/build/scripts/platform_files.lua | 1 + 8 files changed, 27 insertions(+), 1 deletion(-) create mode 160000 third_party/yaml-cpp create mode 100644 third_party/yaml-cpp.lua diff --git a/.gitmodules b/.gitmodules index 27f9b5be8..99c6d5577 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,6 @@ [submodule "testdata/reference-gpu-traces"] path = testdata/reference-gpu-traces url = https://github.com/xenia-project/reference-gpu-traces.git +[submodule "third_party/yaml-cpp"] + path = third_party/yaml-cpp + url = https://github.com/blair1618/yaml-cpp.git diff --git a/premake5.lua b/premake5.lua index 917584437..3431b60da 100644 --- a/premake5.lua +++ b/premake5.lua @@ -170,6 +170,7 @@ solution("xenia") include("third_party/snappy.lua") include("third_party/spirv-tools.lua") include("third_party/xxhash.lua") + include("third_party/yaml-cpp.lua") include("src/xenia") include("src/xenia/app") diff --git a/src/xenia/debug/ui/debug_window.cc b/src/xenia/debug/ui/debug_window.cc index 5526d42bf..cdb87afa4 100644 --- a/src/xenia/debug/ui/debug_window.cc +++ b/src/xenia/debug/ui/debug_window.cc @@ -19,6 +19,7 @@ #include "third_party/capstone/include/x86.h" #include "third_party/imgui/imgui.h" #include "third_party/imgui/imgui_internal.h" +#include "third_party/yaml-cpp/include/yaml-cpp/yaml.h" #include "xenia/base/clock.h" #include "xenia/base/logging.h" #include "xenia/base/math.h" diff --git a/src/xenia/debug/ui/premake5.lua b/src/xenia/debug/ui/premake5.lua index 02ba6a81f..912b1ec0e 100644 --- a/src/xenia/debug/ui/premake5.lua +++ b/src/xenia/debug/ui/premake5.lua @@ -12,10 +12,12 @@ project("xenia-debug-ui") "xenia-cpu", "xenia-debug", "xenia-ui", + "yaml-cpp", }) defines({ }) includedirs({ project_root.."/third_party/gflags/src", + project_root.."/third_party/yaml-cpp/include/", }) local_platform_files() diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc index 8c3cd7236..efef510b6 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc @@ -289,7 +289,7 @@ dword_result_t NtWriteFile(dword_t file_handle, dword_t event_handle, size_t bytes_written = 0; result = file->Write( buffer, buffer_length, - byte_offset_ptr ? static_cast(*byte_offset_ptr) : -1u, + byte_offset_ptr ? static_cast(*byte_offset_ptr) : -1, &bytes_written, apc_context); if (XSUCCEEDED(result)) { info = (int32_t)bytes_written; diff --git a/third_party/yaml-cpp b/third_party/yaml-cpp new file mode 160000 index 000000000..2eba4e6d5 --- /dev/null +++ b/third_party/yaml-cpp @@ -0,0 +1 @@ +Subproject commit 2eba4e6d5670daea6b75c773f1c3dc9e531ddec7 diff --git a/third_party/yaml-cpp.lua b/third_party/yaml-cpp.lua new file mode 100644 index 000000000..138e99a46 --- /dev/null +++ b/third_party/yaml-cpp.lua @@ -0,0 +1,17 @@ +group("third_party") +project("yaml-cpp") + uuid("47bfe853-a3f8-4902-921d-d564608ff355") + kind("StaticLib") + language("C++") + + defines({ + "_LIB", + }) + includedirs({ + "yaml-cpp/include/", + }) + recursive_platform_files("yaml-cpp/include/yaml-cpp") + recursive_platform_files("yaml-cpp/src") + + 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 1818961b2..9168d5a80 100644 --- a/tools/build/scripts/platform_files.lua +++ b/tools/build/scripts/platform_files.lua @@ -6,6 +6,7 @@ local function match_platform_files(base_path, base_match) base_path.."/"..base_match..".h", base_path.."/"..base_match..".c", base_path.."/"..base_match..".cc", + base_path.."/"..base_match..".cpp", }) removefiles({base_path.."/".."**_main.cc"}) removefiles({base_path.."/".."**_test.cc"})