View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015829CMakeModulespublic2015-11-03 06:122016-06-10 14:31
ReporterJulien Bigot 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSDebianOS Versionunstable
Product VersionCMake 3.3.2 
Target VersionFixed in Version 
Summary0015829: GenerateExportHeaders does not work for C
DescriptionThis is a duplicate of issue 0012959 that has been closed as fixed but is not.

The module GenerateExportHeader creates some defines that work for C but it require C++ to be enabled in order to be used. Indeed, the macro check_cxx_compiler_flag is used in many places. That means you can't use project(name C).

A fix for this is proposed in comment 0035809 of issue 0014456
Steps To ReproduceThis example will not works:

project(mylib C)
include(GenerateExportHeader)

add_compiler_export_flags()
add_library(mylib mylib.c)
generate_export_header(mylib)


[...]
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
CMake Error at /usr/share/cmake-3.3/Modules/CheckCXXSourceCompiles.cmake:76 (try_compile):
  Unknown extension ".cxx" for file

    /[...]/CMakeFiles/CMakeTmp/src.cxx

  try_compile() works only for enabled languages. Currently these are:

    C

  See project() command to enable other languages.
Call Stack (most recent call first):
  /usr/share/cmake-3.3/Modules/CheckCXXCompilerFlag.cmake:50 (CHECK_CXX_SOURCE_COMPILES)
  /usr/share/cmake-3.3/Modules/GenerateExportHeader.cmake:223 (check_cxx_compiler_flag)
  /usr/share/cmake-3.3/Modules/GenerateExportHeader.cmake:371 (_test_compiler_hidden_visibility)
  CMakeLists.txt:6 (generate_export_header)
[...]
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0042878)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-11-03 06:12 Julien Bigot New Issue
2016-06-10 14:29 Kitware Robot Note Added: 0042878
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team