New premake flags for debugging anticheat, library loading and forcing unit tests.

- --debug-detections sets the "DEBUG_DETECTIONS" define to show whenever a mismatch in the anticheat hashing occurs.
- --debug-load-library sets the "DEBUG_LOAD_LIBRARY" define to show libraries as they are loaded during runtime in the debug console.
- --force-unit-tests sets the "FORCE_UNIT_TESTS" define to enforce compiling the unit tests into the binary.
This commit is contained in:
/dev/urandom 2016-08-13 19:20:27 +02:00
parent 1db207497b
commit 6dfd22c07a
No known key found for this signature in database
GPG Key ID: 41322B973E0F295E
3 changed files with 26 additions and 10 deletions

View File

@ -15,6 +15,21 @@ newoption {
description = "Copy debug information for binaries as well to the path given via --copy-to."
}
newoption {
trigger = "debug-detections",
description = "Log anticheat detections."
}
newoption {
trigger = "debug-load-library",
description = "Log libraries that get loaded."
}
newoption {
trigger = "force-unit-tests",
description = "Always compile unit tests."
}
newaction {
trigger = "version",
description = "Returns the version string for the current commit of the source code.",
@ -134,6 +149,17 @@ workspace "iw4x"
"$(ProjectDir)src" -- fix for VS IDE
}
-- Debug flags
if _OPTIONS["debug-detections"] then
defines { "DEBUG_DETECTIONS" }
end
if _OPTIONS["debug-load-library"] then
defines { "DEBUG_LOAD_LIBRARY" }
end
if _OPTIONS["force-unit-tests"] then
defines { "FORCE_UNIT_TESTS" }
end
-- Pre-compiled header
pchheader "STDInclude.hpp" -- must be exactly same as used in #include directives
pchsource "src/STDInclude.cpp" -- real path

View File

@ -1,10 +1,3 @@
// Uncomment that to see if we are preventing necessary libraries from being loaded
//#define DEBUG_LOAD_LIBRARY
// Log detections
// Make sure to disable that before releasig!
#define DEBUG_DETECTIONS
namespace Components
{
class AntiCheat : public Component

View File

@ -144,9 +144,6 @@ using namespace std::literals;
#define Assert_Size(x, size) static_assert(sizeof(x) == size, STRINGIZE(x) " structure has an invalid size.")
// Enable unit-test flag for release builds
//#define FORCE_UNIT_TESTS
// Resource stuff
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS