[cmake-developers] [CMake 0013208]: check_symbol_exists() fails when "-pedantic-errors" is added to CMAKE_C_FLAGS

Mantis Bug Tracker mantis at public.kitware.com
Thu May 10 09:24:42 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13208 
====================================================================== 
Reported By:                Antonio Ospite
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13208
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   low
Status:                     new
====================================================================== 
Date Submitted:             2012-05-10 09:24 EDT
Last Modified:              2012-05-10 09:24 EDT
====================================================================== 
Summary:                    check_symbol_exists() fails when "-pedantic-errors"
is added to CMAKE_C_FLAGS
Description: 
Hi,

I just wanted to keep memory of that, the easy workaround is to add
"-pedantic-errors" to more specific variables like CMAKE_C_FLAGS_DEBUG or
CMAKE_C_FLAGS_RELEASE.

Thanks,
   Antonio Ospite
   http://ao2.it

Steps to Reproduce: 
Try with this minimal CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
include(CheckSymbolExists)

set(CMAKE_C_FLAGS "-pedantic-errors")
check_symbol_exists(fwrite stdio.h HAVE_FWRITE)

if (NOT HAVE_FWRITE)
  message(FATAL_ERROR "fwrite not available...")
endif()
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-10 09:24 Antonio Ospite New Issue                                    
======================================================================




More information about the cmake-developers mailing list