瀏覽代碼

Don't attempt to link libstdc++fs when using Clang

On MacOS and (I think) most BSDs the default standard library is libc++, and so attempting to link with libstdc++fs does not work.

On Linux, where (AFAIK) most distros use Clang/libstdc++, this is going to mean link-time failures when using std::filesystem. In this case the user can add Link-Flags: -lstdc++fs to their toolchain file themselves as a fix.
default_compile_flags
Tristan Brindle 4 年之前
父節點
當前提交
e05237b068
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. +8
    -1
      src/dds/toolchain/from_dds.cpp

+ 8
- 1
src/dds/toolchain/from_dds.cpp 查看文件

@@ -570,7 +570,7 @@ toolchain dds::parse_toolchain_dds(const lm::pair_list& pairs, strv context) {
string_seq ret;
if (is_msvc) {
ret = {get_compiler(language::cxx), "/nologo", "/EHsc", "<IN>", "/Fe<OUT>"};
} else if (is_gnu_like) {
} else if (is_gnu) {
ret = {get_compiler(language::cxx),
"-fPIC",
"-fdiagnostics-color",
@@ -578,6 +578,13 @@ toolchain dds::parse_toolchain_dds(const lm::pair_list& pairs, strv context) {
"-pthread",
"-lstdc++fs",
"-o<OUT>"};
} else if (is_clang) {
ret = {get_compiler(language::cxx),
"-fPIC",
"-fdiagnostics-color",
"<IN>",
"-pthread",
"-o<OUT>"};
} else {
assert(false && "No link-exe command");
std::terminate();

Loading…
取消
儲存