On Tuesday 25 July 2006 17:06, David Somers wrote:
> I'm trying to write a test to check if a gcc compiler options is supported.
>
> I can't quite work out how to get the test code to compile with the flag I
> need check. I've tried doing this:
>
> TRY_COMPILE(CMAKE_GCC_VISIBILITY
>       ${CMAKE_BINARY_DIR}
>       ${CMAKE_BINARY_DIR}/CMakeTmp/testGCCvisibility.c
>       CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING=-fvisibility=hidden
>       OUTPUT_VARIABLE OUTPUT
>       )

Dammit... just realized I need to do it like:

TRY_COMPILE(CMAKE_GCC_VISIBILITY
        ${CMAKE_BINARY_DIR}
        ${CMAKE_BINARY_DIR}/CMakeTmp/testGCCvisibility.c
        COMPILE_DEFINITIONS -visibility=hidden
        OUTPUT_VARIABLE OUTPUT
        )

COMPILE_DEFINITIONS really should be called COMPILE_FLAGS, imho.

-- 
David Somers
typographer/programmer/whatever
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to