Mantis Bug Tracker wrote:
> ======================================================================
> Summary:                    GenerateExportHeaders does not work for C
> Description:
> The module GenerateExportHeader creates some defines that may works for C
> too, but actually the module is only intented for C++.
> 
> All attributes may be used for C too, that means you can't use
> project(name C).
> 
> 
> Steps to Reproduce:
> This example will not works:
> 
> project(mylib C)
> include(GenerateExportHeader)
> 
> add_compiler_export_flags()
> add_library(mylib mylib.c)
> generate_export_header(mylib)

Hi,

I'm looking into fixing this bug, and I was wondering how to. I have never 
built C code with CMake. 

I will need to conditionally call different check_compiles macros. Can I so 
something like

if(CMAKE_C_PROJECT)
check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
else()
check_c_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
endif()

?

Thanks,

Steve.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to