Pārlūkot izejas kodu

Default to static linking runtime libs with GCC and Clang

default_compile_flags
vector-of-bool pirms 4 gadiem
vecāks
revīzija
027b7b9a84
2 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. +6
    -0
      src/dds/toolchain/toolchain.cpp
  2. +1
    -0
      tests/deps/use-spdlog/gcc.tc.jsonc

+ 6
- 0
src/dds/toolchain/toolchain.cpp Parādīt failu

@@ -237,6 +237,12 @@ std::optional<toolchain> toolchain::get_builtin(std::string_view tc_id) noexcept
return std::nullopt;
}

if (starts_with(tc_id, "gcc") || starts_with(tc_id, "clang")) {
json5::data& arr = root_map.emplace("link_flags", json5::data::array_type()).first->second;
arr.as_array().emplace_back("-static-libgcc");
arr.as_array().emplace_back("-static-libstdc++");
}

root_map.emplace("c_compiler", opt_triple->c);
root_map.emplace("cxx_compiler", opt_triple->cxx);
root_map.emplace("compiler_id", opt_triple->id);

+ 1
- 0
tests/deps/use-spdlog/gcc.tc.jsonc Parādīt failu

@@ -3,4 +3,5 @@
"cxx_version": 'c++17',
"cxx_compiler": 'g++-9',
"flags": '-DSPDLOG_COMPILED_LIB',
"link_flags": '-static-libgcc -static-libstdc++'
}

Notiek ielāde…
Atcelt
Saglabāt