[cmake-developers] [CMake 0014654]: mingw -isystem flag c header float.h conflict
Mantis Bug Tracker
mantis at public.kitware.com
Mon Dec 16 14:28:52 EST 2013
The following issue has been SUBMITTED.
======================================================================
http://www.cmake.org/Bug/view.php?id=14654
======================================================================
Reported By: jschueller
Assigned To:
======================================================================
Project: CMake
Issue ID: 14654
Category: CMake
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2013-12-16 14:28 EST
Last Modified: 2013-12-16 14:28 EST
======================================================================
Summary: mingw -isystem flag c header float.h conflict
Description:
When including the UseQt4 module combined with cross-compiling with mingw64,
cmake uses these includes (read in the .rsp file):
-isystem /usr/i686-w64-mingw32/include -isystem
/usr/i686-w64-mingw32/include/QtGui -isystem
/usr/i686-w64-mingw32/include/QtCore
... which prevent from using defines like DBL_EPSILON in float.h:
/usr/bin/i686-w64-mingw32-g++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG
@CMakeFiles/main.dir/includes_CXX.rsp -o CMakeFiles/main.dir/main.cxx.obj -c
.../main.cxx
...
error: ‘DBL_EPSILON’ was not declared in this scope
If I remove the -isystem flag, it builds fine.
The -isytem seems to come from
/usr/share/cmake-2.8/Modules/Compiler/GNU.cmake:55:
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
Steps to Reproduce:
The minimal cmakelist using useqt4:
cmake_minimum_required ( VERSION 2.8 )
project ( mingw-test CXX )
find_package ( Qt4 REQUIRED QtCore)
include ( ${QT_USE_FILE} )
add_executable(main main.cxx)
Define a main.cxx:
#include <iostream>
#include "float.h"
int main( int argc, char **argv )
{
std::cout <<DBL_EPSILON<<std::endl;
return 0;
}
Also non-working from c:
#include <stdio.h>
#include <float.h>
int main() {
printf("%g", FLT_EPSILON);
return 0;
}
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-12-16 14:28 jschueller New Issue
======================================================================
More information about the cmake-developers
mailing list