mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-14 17:33:25 +00:00
[mod] Better debuggability.
This commit is contained in:
parent
3846e8d735
commit
20ee8abbb3
2 changed files with 18 additions and 6 deletions
|
|
@ -1,5 +1,9 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#ifdef DONT_OPTIMIZE
|
||||
#pragma optimize("", off)
|
||||
#endif
|
||||
|
||||
// public enums
|
||||
enum aim1_fix : uint32_t {
|
||||
script_function__ISGLIDER = 0x0043A1F6,
|
||||
|
|
@ -444,3 +448,7 @@ BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID) {
|
|||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DONT_OPTIMIZE
|
||||
#pragma optimize("", on)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -657,21 +657,25 @@ private:
|
|||
//fs::copy_file(fn, get_mod_dir() / fn.filename(), fs::copy_options::overwrite_existing);
|
||||
std::string contents;
|
||||
contents += "void build(Solution &s) {\n";
|
||||
contents += "auto &t = s.addSharedLibrary(\"" + name + "\"";
|
||||
contents += " auto &t = s.addSharedLibrary(\"" + name + "\"";
|
||||
if (!version.empty()) {
|
||||
contents += ", \"" + version + "\"";
|
||||
}
|
||||
contents += ");\n";
|
||||
contents += "t += cpp23;\n";
|
||||
contents += "t += \"" + boost::replace_all_copy(fn.string(), "\\", "/") + "\";\n";
|
||||
contents += "t += \"INJECTED_DLL\"_def;\n";
|
||||
contents += " t += cpp23;\n";
|
||||
contents += " t += \"" + boost::replace_all_copy(fn.string(), "\\", "/") + "\";\n";
|
||||
contents += " t += \"INJECTED_DLL\"_def;\n";
|
||||
#if !defined(NDEBUG)
|
||||
contents += " t += \"DONT_OPTIMIZE\"_def;\n";
|
||||
#endif
|
||||
contents += "}\n";
|
||||
write_file(get_mod_dir() / "sw.cpp", contents);
|
||||
|
||||
// when you enable debug build, you cannot distribute this dll,
|
||||
// because user systems does not have debug dll dependencies!!!
|
||||
auto conf = "d"s;
|
||||
#if 1 || defined(NDEBUG)
|
||||
// so we use rwdi
|
||||
auto conf = "rwdi"s;
|
||||
#if defined(NDEBUG)
|
||||
conf = "r";
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue