Wireshark-dev: Re: [Wireshark-dev] Virtual WireShark appliance
From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Tue, 28 Sep 2010 12:53:43 +0200
On Fri, Sep 24, 2010 at 12:42:56PM +0200, Stig Bj?rlykke wrote:
> On Fri, Sep 24, 2010 at 12:33 PM, Joerg Mayer <jmayer@xxxxxxxxx> wrote:
> > That's the type of fix I was hoping for when I rejected the previous one!
> > Nicely spotted.
> 
> I'm still having problems with --as-needed when building with Xcode,
> but not when building with Makefiles.
> CMake reports --as-needed is OK when building for Xcode, but this does
> not work when building.
> 
> Maybe because I get this warning in CMakeOutput.log?
> i686-apple-darwin10-gcc-4.2.1: --as-needed: linker input file unused
> because linking not done

Can you please test the attached patch?

Thanks
   Joerg

-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.
Index: cmake/modules/CheckCLinkerFlag.cmake
===================================================================
--- cmake/modules/CheckCLinkerFlag.cmake	(revision 34270)
+++ cmake/modules/CheckCLinkerFlag.cmake	(working copy)
@@ -12,12 +12,12 @@
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 
-INCLUDE(CheckCSourceCompiles)
+INCLUDE(CheckCSourceRuns)
 
 MACRO (CHECK_C_LINKER_FLAG _FLAG _RESULT)
    SET(CMAKE_REQUIRED_FLAGS "${_FLAG}")
    message(status "check linker flag - test linker flags: ${CMAKE_REQUIRED_FLAGS}")
-   CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT})
+   CHECK_C_SOURCE_RUNS("int main() { return 0;}" ${_RESULT})
    SET(CMAKE_REQUIRED_FLAGS " ")
 ENDMACRO (CHECK_C_LINKER_FLAG)