summaryrefslogtreecommitdiff
path: root/src/configure.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-08-21 12:38:35 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-08-21 12:50:45 +0200
commitc8e7d8922310108f2d46189a8f48abcb68e72534 (patch)
treed29ae8b8da4e10a88344f0412cc7bb3ea0539344 /src/configure.cc
parent33f70be85ef83b0ebeaa6755b67558ae2f5ae8e6 (diff)
WIP: Deferred linking of self
Diffstat (limited to 'src/configure.cc')
-rw-r--r--src/configure.cc39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/configure.cc b/src/configure.cc
index bb94202..8348c19 100644
--- a/src/configure.cc
+++ b/src/configure.cc
@@ -51,40 +51,6 @@ const Configuration& defConfiguration()
#endif
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-void _copyAndRelaunch(int argc, char* argv[],
- const std::string& copy_src,
- const std::string& copy_tar,
- const std::string& compilation_name)
-{
-#ifdef _WIN32
- CopyFile(copy_src.data(), copy_tar.data(), false);
- SetFileAttributes(copy_tar.data(), FILE_ATTRIBUTE_HIDDEN);
- auto t = std::filesystem::last_write_time(copy_src);
- std::filesystem::last_write_time(copy_tar, t);
-
- STARTUPINFO si{};
- PROCESS_INFORMATION pi{};
- si.cb = sizeof(pi);
-
- std::string args = copy_tar + " configure";
- for(int i = 1; i < argc; ++i)
- {
- args += " ";
- args += argv[i];
- }
- args += " --name ";
- args += compilation_name;
-
- CreateProcess(nullptr, args.data(), 0,0,0,0,0,0,&si,&pi);
- exit(1);
-#endif // _WIN32
-}
-
namespace ctor
{
std::optional<std::string> includedir;
@@ -428,11 +394,6 @@ int regenerateCache(Settings& settings,
argv0_file = std::filesystem::current_path() / argv0_file;
}
- if(settings_file.string() == argv0_file.string())
- {
- _copyAndRelaunch(vargs.size(), vargs.data(), vargs[0], "ctor-configure-tmp.exe", settings.name);
- exit(0);
- }
if(host_arch.empty())
{