mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-15 01:43:25 +00:00
[mod] Allow to change dll build type. Do not ship debug builds to users.
This commit is contained in:
parent
80eecee914
commit
bc7e067841
1 changed files with 12 additions and 5 deletions
|
|
@ -668,6 +668,13 @@ private:
|
||||||
contents += "}\n";
|
contents += "}\n";
|
||||||
write_file(get_mod_dir() / "sw.cpp", contents);
|
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)
|
||||||
|
conf = "r";
|
||||||
|
#endif
|
||||||
|
|
||||||
primitives::Command c;
|
primitives::Command c;
|
||||||
c.working_directory = get_mod_dir();
|
c.working_directory = get_mod_dir();
|
||||||
c.push_back("sw");
|
c.push_back("sw");
|
||||||
|
|
@ -675,12 +682,12 @@ private:
|
||||||
c.push_back("-platform");
|
c.push_back("-platform");
|
||||||
c.push_back("x86");
|
c.push_back("x86");
|
||||||
c.push_back("-config");
|
c.push_back("-config");
|
||||||
c.push_back("r");
|
c.push_back(conf);
|
||||||
c.push_back("-config-name");
|
c.push_back("-config-name");
|
||||||
c.push_back("r");
|
c.push_back(conf);
|
||||||
run_command(c);
|
run_command(c);
|
||||||
|
|
||||||
auto dllname = get_mod_dir() / ".sw" / "out" / "r" / get_sw_dll_name();
|
auto dllname = get_mod_dir() / ".sw" / "out" / conf / get_sw_dll_name();
|
||||||
fs::copy_file(dllname, game_dir / get_dll_name(), fs::copy_options::overwrite_existing);
|
fs::copy_file(dllname, game_dir / get_dll_name(), fs::copy_options::overwrite_existing);
|
||||||
files_to_distribute.insert(get_dll_name());
|
files_to_distribute.insert(get_dll_name());
|
||||||
}
|
}
|
||||||
|
|
@ -706,7 +713,7 @@ private:
|
||||||
::memcpy(p + off, to.data(), to.size());
|
::memcpy(p + off, to.data(), to.size());
|
||||||
}
|
}
|
||||||
void prepare_injections() {
|
void prepare_injections() {
|
||||||
#ifdef NDEBUG
|
#if 1 || defined(NDEBUG)
|
||||||
make_injected_dll();
|
make_injected_dll();
|
||||||
#endif
|
#endif
|
||||||
files_to_distribute.insert(aim_exe);
|
files_to_distribute.insert(aim_exe);
|
||||||
|
|
@ -722,7 +729,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
auto push_dll_name = make_insn_with_address("68"_bin, our_data); // push
|
auto push_dll_name = make_insn_with_address("68"_bin, our_data); // push
|
||||||
#ifdef NDEBUG
|
#if 1 || defined(NDEBUG)
|
||||||
strcpy(get_sw_dll_name());
|
strcpy(get_sw_dll_name());
|
||||||
#else
|
#else
|
||||||
strcpy("h:\\Games\\AIM\\1\\.sw\\out\\d\\aim_fixes-0.0.1.dll"s);
|
strcpy("h:\\Games\\AIM\\1\\.sw\\out\\d\\aim_fixes-0.0.1.dll"s);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue