On Jan 21, 2016, at 12:10 PM, David Morsberger <[email protected]> wrote:
> I think this is a bug in cmake because:
>
> 1. the 'and run' in "CheckCSourceRuns: Check if the given C source code
> compiles and runs" should imply linking and executing the software.
Yes, and it *does* imply that.
The problem is that it doesn't let you cleanly specify which linker flags to
use when doing the linking.
I think the underlying problem here is that CMake treats *compiler* flags as
first-class citizens but somewhat neglected *linker* flags.
At minimum, CHECK_C_SOURCE_RUNS should have a CMAKE_REQUIRED_LDFLAGS variable,
which is a string of *linker* command line flags, and should do whatever is
appropriate to pass those flags to the linker. If the linker is run from the
compiler driver program (cc, gcc, clang, whatever), then it should prepend the
"pass this through to the linker" option ("-Wl," or whatever) and provide that
to the compiler during the *link* phase but *not* during the compile phase; if
it's run directly, it should do whatever is necessary to pass the flag to the
linker.
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <[email protected]>
Archives: https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:[email protected]?subject=unsubscribe