xmos / xcommon_cmake

6 stars 5 forks source link

Support linker flags, separate to compiler flags #189

Open danielpieczko opened 1 month ago

danielpieczko commented 1 month ago

Currently, the APP_COMPILER_FLAGS are used for both the compile and link stages of the build.

If you want to provide an option just to the linker, you have to put it in APP_COMPILER_FLAGS and it will be passed to the compiler as well. Often this is ok, particularly with xcc, and such options are accepted but ignored.

However, when using the BUILD_NATIVE option on Windows with MSVC, it is common for compiler flags not to be accepted by the linker (notably -D for compiler definitions) and this results in lots of warnings from the linker for unknown flags.