Wireshark-dev: Re: [Wireshark-dev] rev 50749: /trunk/ /trunk/: CMakeLists.txt
From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Sun, 21 Jul 2013 19:06:21 +0200
Hello Michael,

On Sun, Jul 21, 2013 at 06:45:11PM +0200, Michael Tuexen wrote:
> [mba:wireshark/trunk/build] tuexen% clang --version
> Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
> Target: x86_64-apple-darwin12.4.0

On my system:
Lilly:svn jmayer$ clang --version
Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
Target: x86_64-apple-darwin10

> -- Performing Test WS_C_FLAG_VALID0
> -- Performing Test WS_C_FLAG_VALID0 - Success
...
> -- Performing Test WS_C_FLAG_VALID25 - Success
> -- C-Flags:  -O2 -g -Wall -W -Wextra -Wendif-labels -Wpointer-arith -Warray-bounds -Wformat-security -Wshorten-64-to-32 -Wvla -Waddress -Warray-bounds -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wno-overlength-strings -Wwrite-strings -Wno-long-long -Wc++-compat -Wdeclaration-after-statement -Wshadow -Wno-pointer-sign -Wold-style-definition -Wshadow -Wstrict-prototypes
> CXX-Flags:  -O2 -g -Wall -W -Wextra -Wendif-labels -Wpointer-arith -Warray-bounds -Wformat-security -Wshorten-64-to-32 -Wvla -Waddress -Warray-bounds -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wno-overlength-strings -Wwrite-strings -Wno-long-long

This matches with Guy's analysis although it doesn't show that behaviour on my
system (which is too old no doubt). I will add code to detect that flag and if it
works with gcc and older clang, then I will commit it and hope it will fix the
detection problem on systems with newer clang.

> /* _U_ isn't needed for C++, simply don't name the variable.
>    However, we do need it for some headers that are shared between C and C++. */
> #define _U_ 

> So: It doesn't work. Is there a way I can print the value of CMAKE_C_COMPILER?

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 50757)
+++ CMakeLists.txt      (working copy)
@@ -189,6 +189,8 @@
        -DG_DISABLE_SINGLE_INCLUDES
 )
 
+message(STATUS "C-Compiler: ${CMAKE_C_COMPILER}")
+
 # Counterhack to work around some cache magic in CHECK_C_SOURCE_COMPILES
 include(CheckCCompilerFlag)
 set(C 0)

Thanks for testing
    Jörg

-- 
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.