Sfoglia il codice sorgente

always extend link_exe with link flags

otherwise custom link_executable templates do not work
compile_link_flags
John Robinson 3 anni fa
parent
commit
4ad1cf7adf
Non sono state trovate chiavi note per questa firma nel database
2 ha cambiato i file con 17 aggiunte e 1 eliminazioni
  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 Vedi File

@@ -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 Vedi File

@@ -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…
Annulla
Salva