[Premake] Allow using Utils in both projects

This commit is contained in:
momo5502 2017-01-27 14:44:36 +01:00
parent c15aac546d
commit 8764d8327f
2 changed files with 37 additions and 22 deletions

View File

@ -406,8 +406,9 @@ workspace "iw4x"
-- Pre-build
prebuildcommands
{
"cd %{_MAIN_SCRIPT_DIR}",
"pushd %{_MAIN_SCRIPT_DIR}",
"tools\\premake5 generate-buildinfo",
"popd",
}
-- Post-build
@ -480,15 +481,24 @@ workspace "iw4x"
]]
project "iw4xworker"
kind "WindowedApp"
language "C++"
flags { "C++14" }
files {
"./src/Worker/**.rc",
"./src/Worker/**.hpp",
"./src/Worker/**.cpp",
"./src/Utils/**.hpp",
"./src/Utils/**.cpp",
--"./src/**.proto",
}
removefiles {
"./src/Utils/CSV.*",
"./src/Utils/Cache.*",
"./src/Utils/Stream.*",
"./src/Utils/Hooking.*",
"./src/Utils/InfoString.*",
"./src/Utils/Cryptography.*",
}
includedirs {
"%{prj.location}/src",
--"./src",
@ -519,9 +529,16 @@ project "iw4xworker"
vpaths
{
["Headers/*"] = { "./src/Worker/**.hpp" },
["Headers/Utils/*"] = { "./src/Utils/**.hpp" },
["Sources/*"] = { "./src/Worker/**.cpp" },
["Sources/Utils/*"] = { "./src/Utils/**.cpp" },
["Resource/*"] = { "./src/Worker/**.rc" },
}
else
vpaths
{
["Utils/*"] = { "./src/Utils/**" },
}
end
vpaths
@ -532,26 +549,27 @@ project "iw4xworker"
-- Pre-build
prebuildcommands
{
"cd %{_MAIN_SCRIPT_DIR}",
"pushd %{_MAIN_SCRIPT_DIR}",
"tools\\premake5 generate-buildinfo",
"popd",
}
-- Post-build
if _OPTIONS["copy-to"] then
saneCopyToPath = string.gsub(_OPTIONS["copy-to"] .. "\\", "\\\\", "\\")
postbuildcommands {
"if not exist \"" .. saneCopyToPath .. "\" mkdir \"" .. saneCopyToPath .. "\"",
"if not exist \"" .. saneCopyToPath .. "\" mkdir \"" .. saneCopyToPath .. "iw4x\\\"",
}
if _OPTIONS["copy-pdb"] then
postbuildcommands {
"copy /y \"$(TargetDir)*.pdb\" \"" .. saneCopyToPath .. "\"",
"copy /y \"$(TargetDir)*.pdb\" \"" .. saneCopyToPath .. "iw4x\\\"",
}
end
-- This has to be the last one, as otherwise VisualStudio will succeed building even if copying fails
postbuildcommands {
"copy /y \"$(TargetDir)*.dll\" \"" .. saneCopyToPath .. "\"",
"copy /y \"$(TargetDir)*.exe\" \"" .. saneCopyToPath .. "iw4x\\\"",
}
end
@ -564,7 +582,9 @@ project "iw4xworker"
flags { "Symbols" }
end
kind "ConsoleApp"
configuration "Release*"
kind "WindowedApp"
flags {
"FatalCompileWarnings",
"FatalLinkWarnings",

View File

@ -70,22 +70,17 @@ template <size_t S> class Sizer { };
#include "proto/rcon.pb.h"
#pragma warning(pop)
/*
#include "Utils/IO.hpp"
#include "Utils/CSV.hpp"
#include "Utils/Time.hpp"
#include "Utils/Cache.hpp"
#include "Utils/Chain.hpp"
#include "Utils/Utils.hpp"
#include "Utils/WebIO.hpp"
#include "Utils/Memory.hpp"
#include "Utils/String.hpp"
#include "Utils/Hooking.hpp"
#include "Utils/Library.hpp"
#include "Utils/InfoString.hpp"
#include "Utils/Compression.hpp"
#include "Utils/Cryptography.hpp"
*/
#include "../Utils/IO.hpp"
#include "../Utils/Time.hpp"
#include "../Utils/Chain.hpp"
#include "../Utils/Utils.hpp"
#include "../Utils/WebIO.hpp"
#include "../Utils/Memory.hpp"
#include "../Utils/String.hpp"
#include "../Utils/Library.hpp"
#include "../Utils/Compression.hpp"
// Libraries
#pragma comment(lib, "Winmm.lib")
#pragma comment(lib, "Crypt32.lib")