|
|
|
|
|
|
|
|
if (lang == language::cxx) { |
|
|
if (lang == language::cxx) { |
|
|
extend(ret, {"/EHsc"}); |
|
|
extend(ret, {"/EHsc"}); |
|
|
} |
|
|
} |
|
|
extend(ret, {"/nologo", "/permissive-", "<FLAGS>", "/c", "<IN>", "/Fo<OUT>"}); |
|
|
|
|
|
|
|
|
extend(ret, {"/nologo", "/permissive-", "[flags]", "/c", "[in]", "/Fo[out]"}); |
|
|
} else if (is_gnu_like) { |
|
|
} else if (is_gnu_like) { |
|
|
if (do_optimize.has_value() && *do_optimize) { |
|
|
if (do_optimize.has_value() && *do_optimize) { |
|
|
extend(ret, {"-O2"}); |
|
|
extend(ret, {"-O2"}); |
|
|
|
|
|
|
|
|
if (do_debug.has_value() && *do_debug) { |
|
|
if (do_debug.has_value() && *do_debug) { |
|
|
extend(ret, {"-g"}); |
|
|
extend(ret, {"-g"}); |
|
|
} |
|
|
} |
|
|
extend(ret, {"-fPIC", "-pthread", "<FLAGS>", "-c", "<IN>", "-o<OUT>"}); |
|
|
|
|
|
|
|
|
extend(ret, {"-fPIC", "-pthread", "[flags]", "-c", "[in]", "-o[out]"}); |
|
|
} |
|
|
} |
|
|
if (common_flags) { |
|
|
if (common_flags) { |
|
|
extend(ret, *common_flags); |
|
|
extend(ret, *common_flags); |
|
|
|
|
|
|
|
|
fail(context, "Cannot deduce 'include_template' without 'compiler_id'"); |
|
|
fail(context, "Cannot deduce 'include_template' without 'compiler_id'"); |
|
|
} |
|
|
} |
|
|
if (is_gnu_like) { |
|
|
if (is_gnu_like) { |
|
|
return {"-I", "<PATH>"}; |
|
|
|
|
|
|
|
|
return {"-I", "[path]"}; |
|
|
} else if (is_msvc) { |
|
|
} else if (is_msvc) { |
|
|
return {"/I", "<PATH>"}; |
|
|
|
|
|
|
|
|
return {"/I", "[path]"}; |
|
|
} |
|
|
} |
|
|
assert(false && "'include_template' deduction failed"); |
|
|
assert(false && "'include_template' deduction failed"); |
|
|
std::terminate(); |
|
|
std::terminate(); |
|
|
|
|
|
|
|
|
return tc.include_template; |
|
|
return tc.include_template; |
|
|
} |
|
|
} |
|
|
if (is_gnu_like) { |
|
|
if (is_gnu_like) { |
|
|
return {"-isystem", "<PATH>"}; |
|
|
|
|
|
|
|
|
return {"-isystem", "[path]"}; |
|
|
} else if (is_msvc) { |
|
|
} else if (is_msvc) { |
|
|
// MSVC has external-header support inbound, but it is not fully ready yet |
|
|
// MSVC has external-header support inbound, but it is not fully ready yet |
|
|
return {"/I", "<PATH>"}; |
|
|
|
|
|
|
|
|
return {"/I", "[path]"}; |
|
|
} |
|
|
} |
|
|
assert(false && "external_include_template deduction failed"); |
|
|
assert(false && "external_include_template deduction failed"); |
|
|
std::terminate(); |
|
|
std::terminate(); |
|
|
|
|
|
|
|
|
fail(context, "Cannot deduce 'define_template' without 'compiler_id'"); |
|
|
fail(context, "Cannot deduce 'define_template' without 'compiler_id'"); |
|
|
} |
|
|
} |
|
|
if (is_gnu_like) { |
|
|
if (is_gnu_like) { |
|
|
return {"-D", "<DEF>"}; |
|
|
|
|
|
|
|
|
return {"-D", "[def]"}; |
|
|
} else if (is_msvc) { |
|
|
} else if (is_msvc) { |
|
|
return {"/D", "<DEF>"}; |
|
|
|
|
|
|
|
|
return {"/D", "[def]"}; |
|
|
} |
|
|
} |
|
|
assert(false && "define_template deduction failed"); |
|
|
assert(false && "define_template deduction failed"); |
|
|
std::terminate(); |
|
|
std::terminate(); |
|
|
|
|
|
|
|
|
fail(context, "Unable to deduce archive creation rules without a 'compiler_id'"); |
|
|
fail(context, "Unable to deduce archive creation rules without a 'compiler_id'"); |
|
|
} |
|
|
} |
|
|
if (is_msvc) { |
|
|
if (is_msvc) { |
|
|
return {"lib", "/nologo", "/OUT:<OUT>", "<IN>"}; |
|
|
|
|
|
|
|
|
return {"lib", "/nologo", "/OUT:[out]", "[in]"}; |
|
|
} else if (is_gnu_like) { |
|
|
} else if (is_gnu_like) { |
|
|
return {"ar", "rcs", "<OUT>", "<IN>"}; |
|
|
|
|
|
|
|
|
return {"ar", "rcs", "[out]", "[in]"}; |
|
|
} |
|
|
} |
|
|
assert(false && "No archive command"); |
|
|
assert(false && "No archive command"); |
|
|
std::terminate(); |
|
|
std::terminate(); |
|
|
|
|
|
|
|
|
ret = {get_compiler_executable_path(language::cxx), |
|
|
ret = {get_compiler_executable_path(language::cxx), |
|
|
"/nologo", |
|
|
"/nologo", |
|
|
"/EHsc", |
|
|
"/EHsc", |
|
|
"<IN>", |
|
|
|
|
|
"/Fe<OUT>"}; |
|
|
|
|
|
|
|
|
"[in]", |
|
|
|
|
|
"/Fe[out]"}; |
|
|
} else if (is_gnu_like) { |
|
|
} else if (is_gnu_like) { |
|
|
ret = {get_compiler_executable_path(language::cxx), |
|
|
ret = {get_compiler_executable_path(language::cxx), |
|
|
"-fPIC", |
|
|
"-fPIC", |
|
|
"<IN>", |
|
|
|
|
|
|
|
|
"[in]", |
|
|
"-pthread", |
|
|
"-pthread", |
|
|
"-o<OUT>"}; |
|
|
|
|
|
|
|
|
"-o[out]"}; |
|
|
} else { |
|
|
} else { |
|
|
assert(false && "No link-exe command"); |
|
|
assert(false && "No link-exe command"); |
|
|
std::terminate(); |
|
|
std::terminate(); |