summaryrefslogtreecommitdiff
path: root/src/rebuild.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebuild.cc')
-rw-r--r--src/rebuild.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rebuild.cc b/src/rebuild.cc
index 353beb0..7c90fca 100644
--- a/src/rebuild.cc
+++ b/src/rebuild.cc
@@ -60,12 +60,24 @@ int unreg(const char* location)
void recompileCheck(const Settings& settings, int argc, char* argv[],
bool force, bool relaunch_allowed)
{
+ using namespace std::string_literals;
+
bool dirty{force};
std::vector<std::string> args;
args.push_back("-s");
args.push_back("-O3");
args.push_back("-std=c++17");
+
+ if(hasConfiguration(cfg::ctor_includedir))
+ {
+ args.push_back("-I"s + getConfiguration(cfg::ctor_includedir));
+ }
+ if(hasConfiguration(cfg::ctor_libdir))
+ {
+ args.push_back("-L"s + getConfiguration(cfg::ctor_libdir));
+ }
+ args.push_back("-lctor");
args.push_back("-pthread");
std::filesystem::path binFile(argv[0]);
@@ -113,7 +125,7 @@ void recompileCheck(const Settings& settings, int argc, char* argv[],
args.push_back(location);
}
}
- args.push_back("libctor.a");
+
args.push_back("-o");
args.push_back(binFile.string());