Merge pull request #177 from diamante0018/update-premake5-remove-iw4vm

Update premake5 - Remove iw4mvm
This commit is contained in:
Dss0 2022-01-26 14:41:15 +01:00 committed by GitHub
commit 96b38e154b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 36 additions and 167 deletions

View File

@ -12,7 +12,7 @@ on:
jobs:
build:
name: Build binaries
runs-on: windows-latest
runs-on: windows-2022
strategy:
matrix:
configuration:
@ -36,11 +36,11 @@ jobs:
lfs: false
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v1.1
- name: Generate project files
#run: tools/premake5 vs2019 --ci-build
run: tools/premake5 vs2019 --ac-disable
#run: tools/premake5 vs2022 --ci-build --ac-disable
run: tools/premake5 vs2022 --ac-disable
- name: Set up problem matching
uses: ammaraskar/msvc-problem-matcher@master

View File

@ -11,7 +11,7 @@
## How to compile
- Run `premake5 vs2019` or use the delivered `generate.bat`.
- Run `premake5 vs2022` or use the delivered `generate.bat`.
- Build via solution file in `build\iw4x.sln`. (You can use the `build.bat` script to do it quick and easy.)
## Premake arguments

View File

@ -4,8 +4,8 @@ version: "#{build} ({branch})"
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PREMAKE_ACTION: vs2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PREMAKE_ACTION: vs2022
configuration:
- Debug

View File

@ -1,4 +1,4 @@
@echo off
echo Updating submodules...
call git submodule update --init --recursive
call tools\premake5 %* vs2019 --ac-disable
call tools\premake5 %* vs2022 --ac-disable

View File

@ -1,54 +0,0 @@
iw4mvm = {
settings = nil
}
function iw4mvm.setup(settings)
if not settings.source then error("Missing source.") end
iw4mvm.settings = settings
if not iw4mvm.settings.defines then iw4mvm.settings.defines = {} end
end
function iw4mvm.import()
if not iw4mvm.settings then error("You need to call iw4mvm.setup first") end
links { "iw4mvm" }
iw4mvm.includes()
end
function iw4mvm.includes()
if not iw4mvm.settings then error("You need to call iw4mvm.setup first") end
includedirs { iw4mvm.settings.source }
libdirs { path.join(iw4mvm.settings.source, "IW4MVM") }
defines(iw4mvm.settings.defines)
end
function iw4mvm.project()
if not iw4mvm.settings then error("You need to call iw4mvm.setup first") end
project "iw4mvm"
language "C++"
characterset ("MBCS")
defines("_CRT_SECURE_NO_WARNINGS")
iw4mvm.includes()
files
{
path.join(iw4mvm.settings.source, "IW4MVM/*.h"),
path.join(iw4mvm.settings.source, "IW4MVM/*.cpp"),
}
removefiles
{
--path.join(iw4mvm.settings.source, "IW4MVM/detours.cpp"),
path.join(iw4mvm.settings.source, "IW4MVM/DllMain.cpp"),
}
-- not our code, ignore POSIX usage warnings for now
warnings "Off"
kind "StaticLib"
end

View File

@ -193,7 +193,6 @@ require "premake/pdcurses"
require "premake/protobuf"
require "premake/zlib"
require "premake/udis86"
require "premake/iw4mvm"
require "premake/dxsdk"
json11.setup
@ -240,15 +239,6 @@ udis86.setup
{
source = path.join(depsBasePath, "udis86"),
}
iw4mvm.setup
{
defines = {
"IW4X",
"DETOURS_X86",
"DETOURS_32BIT",
},
source = path.join(depsBasePath, "iw4mvm"),
}
dxsdk.setup
{
source = path.join(depsBasePath, "dxsdk"),
@ -260,34 +250,44 @@ workspace "iw4x"
objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.buildcfg}"
buildlog "%{wks.location}/obj/%{cfg.architecture}/%{cfg.buildcfg}/%{prj.name}/%{prj.name}.log"
configurations { "Debug", "Release" }
language "C++"
cppdialect "C++17"
architecture "x86"
platforms "x86"
--exceptionhandling ("SEH")
systemversion "latest"
symbols "On"
staticruntime "On"
editandcontinue "Off"
warnings "Extra"
characterset "ASCII"
configuration "windows"
flags { "NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks" }
filter "platforms:x86"
defines {"_WINDOWS", "WIN32"}
filter {}
configuration "Release*"
defines { "NDEBUG" }
flags { "MultiProcessorCompile", "LinkTimeOptimization", "No64BitChecks" }
filter "configurations:Release"
optimize "On"
buildoptions { "/GL" }
linkoptions { "/IGNORE:4702", "/LTCG" }
defines { "NDEBUG" }
flags { "FatalCompileWarnings", "FatalLinkWarnings" }
if not _OPTIONS["force-unit-tests"] then
rtti ("Off")
end
filter {}
configuration "Debug*"
defines { "DEBUG", "_DEBUG" }
flags { "MultiProcessorCompile", "No64BitChecks" }
filter "configurations:Debug"
optimize "Debug"
if symbols ~= nil then
symbols "On"
else
flags { "Symbols" }
end
defines { "DEBUG", "_DEBUG" }
filter {}
project "iw4x"
kind "SharedLib"
@ -347,7 +347,6 @@ workspace "iw4x"
protobuf.import()
zlib.import()
udis86.import()
--iw4mvm.import()
dxsdk.import()
-- fix vpaths for protobuf sources
@ -401,23 +400,6 @@ workspace "iw4x"
}
end
-- Specific configurations
flags { "UndefinedIdentifiers" }
warnings "Extra"
if symbols ~= nil then
symbols "On"
else
flags { "Symbols" }
end
configuration "Release*"
flags {
"FatalCompileWarnings",
"FatalLinkWarnings",
}
configuration {}
--[[
-- Generate source code from protobuf definitions
rules { "ProtobufCompiler" }
@ -461,11 +443,6 @@ workspace "iw4x"
protobuf.project()
zlib.project()
udis86.project()
--iw4mvm.project()
workspace "*"
cppdialect "C++17"
defines { "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS" }
rule "ProtobufCompiler"
display "Protobuf compiler"

View File

@ -48,9 +48,6 @@ namespace Components
Loader::Register(new Party());
Loader::Register(new Zones());
Loader::Register(new D3D9Ex());
#if (!defined(VLD_RPTHOOK_INSTALL) || defined(VLDEnable)) && defined(COMPILE_IW4MVM) // IW4MVM uses detours which produces memory leaks, but those are not really relevant
Loader::Register(new IW4MVM());
#endif
Loader::Register(new Logger());
Loader::Register(new Script());
Loader::Register(new Weapon());

View File

@ -88,7 +88,6 @@ namespace Components
#include "Modules/Node.hpp"
#include "Modules/RCon.hpp"
#include "Modules/Party.hpp" // Destroys the order, but requires network classes :D
#include "Modules/IW4MVM.hpp"
#include "Modules/Logger.hpp"
#include "Modules/Friends.hpp"
#include "Modules/IPCPipe.hpp"

View File

@ -634,7 +634,7 @@ namespace Components
LUID luid;
TOKEN_PRIVILEGES tp = { 0 };
DWORD cb = sizeof(TOKEN_PRIVILEGES);
if (!LookupPrivilegeValueW(nullptr, SE_DEBUG_NAME, &luid)) return;
if (!LookupPrivilegeValueA(nullptr, SE_DEBUG_NAME, &luid)) return;
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;

View File

@ -1,36 +0,0 @@
#include "STDInclude.hpp"
#ifdef COMPILE_IW4MVM
#include <IW4MVM/client_main.h>
#endif
namespace Components
{
IW4MVM::IW4MVM()
{
if (Dedicated::IsEnabled() || ZoneBuilder::IsEnabled() || Monitor::IsEnabled() || Loader::IsPerformingUnitTests()) return;
DWORD oldProtect;
std::uint8_t* _module = reinterpret_cast<std::uint8_t*>(GetModuleHandle(nullptr));
VirtualProtect(_module + 0x1000, 0x2D6000, PAGE_EXECUTE_READWRITE, &oldProtect);
#ifdef COMPILE_IW4MVM
client_main::Init();
Scheduler::Once(client_main::PostInit);
#endif
Scheduler::OnFrame([]()
{
if (!Game::CL_IsCgameInitialized())
{
Dvar::Var("com_timescale").set(1.0f);
}
});
VirtualProtect(_module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect);
}
IW4MVM::~IW4MVM()
{
}
}

View File

@ -1,14 +0,0 @@
#pragma once
// Disabled for public release
//#define COMPILE_IW4MVM
namespace Components
{
class IW4MVM : public Component
{
public:
IW4MVM();
~IW4MVM();
};
}

View File

@ -784,7 +784,7 @@ namespace Components
{
if (pack.index == dlc)
{
ShellExecute(0, 0, L"https://xlabs.dev/support_iw4x_client.html", 0, 0, SW_SHOW);
ShellExecuteW(0, 0, L"https://xlabs.dev/support_iw4x_client.html", 0, 0, SW_SHOW);
return;
}
}

View File

@ -107,12 +107,12 @@ namespace Utils
void SetEnvironment()
{
wchar_t exeName[512];
GetModuleFileName(GetModuleHandle(nullptr), exeName, sizeof(exeName) / 2);
GetModuleFileNameW(GetModuleHandle(nullptr), exeName, sizeof(exeName) / 2);
wchar_t* exeBaseName = wcsrchr(exeName, L'\\');
exeBaseName[0] = L'\0';
SetCurrentDirectory(exeName);
SetCurrentDirectoryW(exeName);
}
HMODULE GetNTDLL()

Binary file not shown.