diff options
Diffstat (limited to 'src/rebuild.cc')
| -rw-r--r-- | src/rebuild.cc | 41 | 
1 files changed, 8 insertions, 33 deletions
diff --git a/src/rebuild.cc b/src/rebuild.cc index cfbe790..9ddf5ba 100644 --- a/src/rebuild.cc +++ b/src/rebuild.cc @@ -152,63 +152,40 @@ bool recompileCheck(const Settings& global_settings, int argc, char* argv[],  	{  		std::cout << "Recompile check (" << numConfigFiles << "):\n";  	} -	std::filesystem::path settings_file(global_settings.name); -	std::filesystem::path argv0_file(argv[0]); - -	if(settings_file.is_relative()) -	{ -		settings_file = std::filesystem::current_path() / settings_file; -	} -	if(argv0_file.is_relative()) -	{ -		argv0_file = std::filesystem::current_path() / argv0_file; -	}  	BuildConfiguration config; -	config.type = TargetType::Executable;  	config.name = "ctor";  	config.system = OutputSystem::Build;  	auto tool_chain = getToolChain(config.system);  	append(config.flags.cxxflags, -	       getOption(tool_chain, opt::optimization, "2")); +	       getOption(tool_chain, opt::optimization, "3"));  	append(config.flags.cxxflags,  	       getOption(tool_chain, opt::cpp_std, "c++20")); -	config.flags.cxxflags.push_back("/nologo");  	if(hasConfiguration(cfg::ctor_includedir))  	{  		append(config.flags.cxxflags,  		       getOption(tool_chain, opt::include_path,  		                 getConfiguration(cfg::ctor_includedir)));  	} -  	if(hasConfiguration(cfg::ctor_libdir))  	{  		append(config.flags.ldflags,  		       getOption(tool_chain, opt::library_path,  		                 getConfiguration(cfg::ctor_libdir)));  	} -//	append(config.flags.ldflags, getOption(tool_chain, opt::link, "ctor")); -	config.flags.ldflags.push_back("build/libctor.lib"); +	append(config.flags.ldflags, getOption(tool_chain, opt::link, "ctor"));  	append(config.flags.ldflags, getOption(tool_chain, opt::threads)); -	config.flags.ldflags.push_back("/nologo"); -	config.flags.ldflags.push_back("/SUBSYSTEM:CONSOLE"); -  	Settings settings{global_settings}; -	settings.parallel_processes = 1; -	settings.verbose = 2;//-1; // Make check completely silent. +	settings.verbose = -1; // Make check completely silent.  	settings.builddir += "/ctor"; // override builddir to use ctor subdir +  	{  		std::filesystem::path buildfile  = settings.builddir; -		std::filesystem::path currentfile = settings.name; - -		if(currentfile.is_relative()) -		{ -			currentfile = std::filesystem::current_path() / currentfile; -		} +		std::filesystem::path currentfile = argv[0];  		config.target = std::filesystem::relative(currentfile, buildfile).string();  	} @@ -247,7 +224,7 @@ bool recompileCheck(const Settings& global_settings, int argc, char* argv[],  		}  	} -	auto tasks = taskFactory({config}, settings, {}, true); +	auto tasks = taskFactory({config}, settings, {});  	for(auto task : tasks)  	{ @@ -270,8 +247,6 @@ bool recompileCheck(const Settings& global_settings, int argc, char* argv[],  	}  	auto dirty_tasks = build(settings, "ctor", tasks, true); // dryrun - -	bool was_rebuilt{false};  	if(dirty_tasks)  	{  		std::cout << "Rebuilding config.\n"; @@ -280,7 +255,6 @@ bool recompileCheck(const Settings& global_settings, int argc, char* argv[],  		{  			return ret;  		} -		was_rebuilt = true;  	}  	if(reconfigure) @@ -295,11 +269,12 @@ bool recompileCheck(const Settings& global_settings, int argc, char* argv[],  		{  			args.push_back(argv[i]);  		} -		auto ret = execute(settings.name, args, {}); +		auto ret = execute(argv[0], args);  		//if(ret != 0)  		{  			exit(ret);  		} +  	}  	return dirty_tasks;  | 
