21#ifndef CBUILD_MINGW_GXXMT_TOOLCHAIN
22#define CBUILD_MINGW_GXXMT_TOOLCHAIN
34template <CBuild::HashImpl hash = CBuild::CBuildHashV2>
48 this->
linker =
"x86_64-w64-mingw32-g++";
49 this->
compiler =
"x86_64-w64-mingw32-g++";
50 this->
packer =
"x86_64-w64-mingw32-ar cr";
65 this->
linker =
"x86_64-w64-mingw32-g++";
66 this->
compiler =
"x86_64-w64-mingw32-g++";
67 this->
packer =
"x86_64-w64-mingw32-ar cr";
85 std::atomic_int64_t read_ptr;
86 read_ptr.store(files.size() - 1);
88 unsigned int num_threads = std::thread::hardware_concurrency();
90 std::thread threads[num_threads];
91 for (
unsigned int i = 0; i < num_threads; i++) {
92 threads[i] = std::thread([&files,
this, &
args, &read_ptr](
void) ->
void {
95 int64_t i = read_ptr.fetch_sub(1);
101 cmd += files.at(i).key;
105 cmd += files.at(i).data;
107 std::this_thread::get_id();
113 for (
unsigned int i = 0; i < num_threads; i++) {
128 for (
unsigned int i = 0; i < files.size(); i++) {
129 flist += files.at(i).data;
132 if (files.size() > 0) {
154 for (
unsigned int i = 0; i < files.size(); i++) {
155 flist += files.at(i).data;
158 if (files.size() > 0) {
170 for (std::string
id : this->
depends) {
172 if (target != NULL) {
173 auto out_path = target->gen_out_name(
".exe",
".dll");
174 unsigned int end_slash = out_path.find_last_of(
'/');
176 "/" + out_path.substr(end_slash + 1);
183 std::string
gen_out_name(std::string executable =
".exe", std::string dyn_lib =
".dll",
184 std::string stat_lib =
".a")
override {
186 if (this->
name != std::string(
"")) {
282 void run(std::vector<std::string>*
args)
override {
284 std::string pargs =
"";
286 for (
auto elem : *
args) {
293 cmd = this->wine +
" ";
301 void debug(std::vector<std::string>*
args, std::vector<std::string>* pargs)
override {
#define CBUILD_BUILD_OUT_DIR
Build out in build/toolchain.
#define CBUILD_BUILD_DIR
Build directory of CBuild.
void run(std::vector< std::string > *args) override
Run builded app.
void build() override
Build.
void debug(std::vector< std::string > *args, std::vector< std::string > *pargs) override
Build program in debug mode and after run gdb on it.
MINGW_GXXMT(std::string id)
Construct a new MINGW_GXXMT object.
void post_link() override
After linking.
std::string gen_out_name(std::string executable=".exe", std::string dyn_lib=".dll", std::string stat_lib=".a") override
Generate output file name (after linking)
MINGW_GXXMT(std::string id, std::string name)
Construct a new MINGW_GXXMT object.
void link_pack() override
Linking for static libraries.
void link() override
Linking.
CBuild::Toolchain * GetToolchain(std::string name, bool force=false)
Get the registered toolchain.
bool copy(std::string start, std::string end)
Copy files or directories.
Filebuffer for CBuild ecosystem.
uint64_t hash(std::string str)
FNV-1a hashing function for std::string.
void print(std::string msg, color fg=CBuild::WHITE)
Print colored text to STDOUT.
int system(std::string cmd)
Call stdlib system() and print cmd to shell.
Custom print that support color codes.
Command for compile_commands.json.