tum-ei-eda / etiss

Extendable Translating Instruction Set Simulator
https://tum-ei-eda.github.io/etiss/
Other
29 stars 36 forks source link

Prevent linker option duplicates when calling pulpino macro for multiple targets #75

Closed fpedd closed 3 years ago

fpedd commented 3 years ago

When building multiple targets from a single CMake script using the ADD_EXECUTABLE_PULPINO macro, e.g. as follows:

...
ADD_EXECUTABLE_PULPINO(riscv_example.elf main.c)
ADD_EXECUTABLE_PULPINO(riscv_example_fancy.elf main.c fancy.c)
...

the linker (rightfully) complains about duplicate option definitions. For example the linker script option -T:

error: linker script file installed/examples/SW/riscv/cmake/pulpino_tumeda/link.ld' appears multiple times

in CMAKE_EXE_LINKER_FLAGS.

@rafzi this is most likely not the prettiest fix, but "minimally invasive".