Selaa lähdekoodia

always extend link_exe with link flags

otherwise custom link_executable templates do not work
compile_link_flags
John Robinson 3 vuotta sitten
vanhempi
commit
4ad1cf7adf
No known key found for this signature in database
2 muutettua tiedostoa jossa 17 lisäystä ja 1 poistoa
  1. +1
    -1
      src/dds/toolchain/from_json.cpp
  2. +16
    -0
      src/dds/toolchain/from_json.test.cpp

+ 1
- 1
src/dds/toolchain/from_json.cpp Näytä tiedosto

@@ -716,9 +716,9 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
assert(false && "No link-exe command");
std::terminate();
}
extend(ret, get_link_flags());
return ret;
});
extend(tc.link_exe, get_link_flags());

tc.tty_flags = read_opt(tty_flags, [&]() -> string_seq {
if (!compiler_id) {

+ 16
- 0
src/dds/toolchain/from_json.test.cpp Näytä tiedosto

@@ -93,6 +93,22 @@ TEST_CASE("Generating toolchain commands") {
"ar rcs stuff.a foo.o bar.o",
"g++ -fPIC foo.o bar.a -pthread -omeow.exe");

check_tc_compile("{compiler_id: 'gnu', link_flags: '-mthumb'}",
"g++ -fPIC -pthread -MD -MF foo.o.d -MQ foo.o -c foo.cpp -ofoo.o",
"g++ -fPIC -pthread -Wall -Wextra -Wpedantic -Wconversion "
"-MD -MF foo.o.d -MQ foo.o -c foo.cpp -ofoo.o",
"ar rcs stuff.a foo.o bar.o",
"g++ -fPIC foo.o bar.a -pthread -omeow.exe -mthumb");

check_tc_compile(
"{compiler_id: 'gnu', link_flags: '-mthumb', advanced: {link_executable: 'g++ [in] "
"-o[out]'}}",
"g++ -fPIC -pthread -MD -MF foo.o.d -MQ foo.o -c foo.cpp -ofoo.o",
"g++ -fPIC -pthread -Wall -Wextra -Wpedantic -Wconversion "
"-MD -MF foo.o.d -MQ foo.o -c foo.cpp -ofoo.o",
"ar rcs stuff.a foo.o bar.o",
"g++ foo.o bar.a -omeow.exe -mthumb");

check_tc_compile("{compiler_id: 'msvc'}",
"cl.exe /MT /EHsc /nologo /permissive- /showIncludes /c foo.cpp /Fofoo.o",
"cl.exe /MT /EHsc /nologo /permissive- /W4 /showIncludes /c foo.cpp /Fofoo.o",

Loading…
Peruuta
Tallenna