[Premake] Allow using Utils in both projects
This commit is contained in:
parent
c15aac546d
commit
8764d8327f
32
premake5.lua
32
premake5.lua
@ -406,8 +406,9 @@ workspace "iw4x"
|
|||||||
-- Pre-build
|
-- Pre-build
|
||||||
prebuildcommands
|
prebuildcommands
|
||||||
{
|
{
|
||||||
"cd %{_MAIN_SCRIPT_DIR}",
|
"pushd %{_MAIN_SCRIPT_DIR}",
|
||||||
"tools\\premake5 generate-buildinfo",
|
"tools\\premake5 generate-buildinfo",
|
||||||
|
"popd",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Post-build
|
-- Post-build
|
||||||
@ -480,15 +481,24 @@ workspace "iw4x"
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
project "iw4xworker"
|
project "iw4xworker"
|
||||||
kind "WindowedApp"
|
|
||||||
language "C++"
|
language "C++"
|
||||||
flags { "C++14" }
|
flags { "C++14" }
|
||||||
files {
|
files {
|
||||||
"./src/Worker/**.rc",
|
"./src/Worker/**.rc",
|
||||||
"./src/Worker/**.hpp",
|
"./src/Worker/**.hpp",
|
||||||
"./src/Worker/**.cpp",
|
"./src/Worker/**.cpp",
|
||||||
|
"./src/Utils/**.hpp",
|
||||||
|
"./src/Utils/**.cpp",
|
||||||
--"./src/**.proto",
|
--"./src/**.proto",
|
||||||
}
|
}
|
||||||
|
removefiles {
|
||||||
|
"./src/Utils/CSV.*",
|
||||||
|
"./src/Utils/Cache.*",
|
||||||
|
"./src/Utils/Stream.*",
|
||||||
|
"./src/Utils/Hooking.*",
|
||||||
|
"./src/Utils/InfoString.*",
|
||||||
|
"./src/Utils/Cryptography.*",
|
||||||
|
}
|
||||||
includedirs {
|
includedirs {
|
||||||
"%{prj.location}/src",
|
"%{prj.location}/src",
|
||||||
--"./src",
|
--"./src",
|
||||||
@ -519,9 +529,16 @@ project "iw4xworker"
|
|||||||
vpaths
|
vpaths
|
||||||
{
|
{
|
||||||
["Headers/*"] = { "./src/Worker/**.hpp" },
|
["Headers/*"] = { "./src/Worker/**.hpp" },
|
||||||
|
["Headers/Utils/*"] = { "./src/Utils/**.hpp" },
|
||||||
["Sources/*"] = { "./src/Worker/**.cpp" },
|
["Sources/*"] = { "./src/Worker/**.cpp" },
|
||||||
|
["Sources/Utils/*"] = { "./src/Utils/**.cpp" },
|
||||||
["Resource/*"] = { "./src/Worker/**.rc" },
|
["Resource/*"] = { "./src/Worker/**.rc" },
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
vpaths
|
||||||
|
{
|
||||||
|
["Utils/*"] = { "./src/Utils/**" },
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
vpaths
|
vpaths
|
||||||
@ -532,26 +549,27 @@ project "iw4xworker"
|
|||||||
-- Pre-build
|
-- Pre-build
|
||||||
prebuildcommands
|
prebuildcommands
|
||||||
{
|
{
|
||||||
"cd %{_MAIN_SCRIPT_DIR}",
|
"pushd %{_MAIN_SCRIPT_DIR}",
|
||||||
"tools\\premake5 generate-buildinfo",
|
"tools\\premake5 generate-buildinfo",
|
||||||
|
"popd",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Post-build
|
-- Post-build
|
||||||
if _OPTIONS["copy-to"] then
|
if _OPTIONS["copy-to"] then
|
||||||
saneCopyToPath = string.gsub(_OPTIONS["copy-to"] .. "\\", "\\\\", "\\")
|
saneCopyToPath = string.gsub(_OPTIONS["copy-to"] .. "\\", "\\\\", "\\")
|
||||||
postbuildcommands {
|
postbuildcommands {
|
||||||
"if not exist \"" .. saneCopyToPath .. "\" mkdir \"" .. saneCopyToPath .. "\"",
|
"if not exist \"" .. saneCopyToPath .. "\" mkdir \"" .. saneCopyToPath .. "iw4x\\\"",
|
||||||
}
|
}
|
||||||
|
|
||||||
if _OPTIONS["copy-pdb"] then
|
if _OPTIONS["copy-pdb"] then
|
||||||
postbuildcommands {
|
postbuildcommands {
|
||||||
"copy /y \"$(TargetDir)*.pdb\" \"" .. saneCopyToPath .. "\"",
|
"copy /y \"$(TargetDir)*.pdb\" \"" .. saneCopyToPath .. "iw4x\\\"",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This has to be the last one, as otherwise VisualStudio will succeed building even if copying fails
|
-- This has to be the last one, as otherwise VisualStudio will succeed building even if copying fails
|
||||||
postbuildcommands {
|
postbuildcommands {
|
||||||
"copy /y \"$(TargetDir)*.dll\" \"" .. saneCopyToPath .. "\"",
|
"copy /y \"$(TargetDir)*.exe\" \"" .. saneCopyToPath .. "iw4x\\\"",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -564,7 +582,9 @@ project "iw4xworker"
|
|||||||
flags { "Symbols" }
|
flags { "Symbols" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
kind "ConsoleApp"
|
||||||
configuration "Release*"
|
configuration "Release*"
|
||||||
|
kind "WindowedApp"
|
||||||
flags {
|
flags {
|
||||||
"FatalCompileWarnings",
|
"FatalCompileWarnings",
|
||||||
"FatalLinkWarnings",
|
"FatalLinkWarnings",
|
||||||
|
@ -70,22 +70,17 @@ template <size_t S> class Sizer { };
|
|||||||
#include "proto/rcon.pb.h"
|
#include "proto/rcon.pb.h"
|
||||||
|
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
/*
|
|
||||||
#include "Utils/IO.hpp"
|
#include "../Utils/IO.hpp"
|
||||||
#include "Utils/CSV.hpp"
|
#include "../Utils/Time.hpp"
|
||||||
#include "Utils/Time.hpp"
|
#include "../Utils/Chain.hpp"
|
||||||
#include "Utils/Cache.hpp"
|
#include "../Utils/Utils.hpp"
|
||||||
#include "Utils/Chain.hpp"
|
#include "../Utils/WebIO.hpp"
|
||||||
#include "Utils/Utils.hpp"
|
#include "../Utils/Memory.hpp"
|
||||||
#include "Utils/WebIO.hpp"
|
#include "../Utils/String.hpp"
|
||||||
#include "Utils/Memory.hpp"
|
#include "../Utils/Library.hpp"
|
||||||
#include "Utils/String.hpp"
|
#include "../Utils/Compression.hpp"
|
||||||
#include "Utils/Hooking.hpp"
|
|
||||||
#include "Utils/Library.hpp"
|
|
||||||
#include "Utils/InfoString.hpp"
|
|
||||||
#include "Utils/Compression.hpp"
|
|
||||||
#include "Utils/Cryptography.hpp"
|
|
||||||
*/
|
|
||||||
// Libraries
|
// Libraries
|
||||||
#pragma comment(lib, "Winmm.lib")
|
#pragma comment(lib, "Winmm.lib")
|
||||||
#pragma comment(lib, "Crypt32.lib")
|
#pragma comment(lib, "Crypt32.lib")
|
||||||
|
Loading…
Reference in New Issue
Block a user