LDFLAGS were previously added after other compilation flags when
linking, but not after object files. This causes an issue when
attempting to statically compile, as objects cannot pull from libraries
put before them on the link line. This change assures that LDFLAGS is
always appended after the object files.
Details
Details
- Reviewers
kristof.beyls MatzeB cmatthews
Diff Detail
Diff Detail
Event Timeline
Comment Actions
It surprised me that target_link_libraries can be used for arbitrary flags, but the cmake docu says so so this is fine.
I wonder if you can just replace the two append_ldflags(${source_exename} LDFLAGS) calls with target_link_libraries(${source_exename} ${LDFLAGS}) and remove the whole append_ldflags macro?