MantisBT - CMake | |||||||||||||||
View Issue Details | |||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||
0015361 | CMake | CMake | public | 2015-01-19 18:28 | 2016-06-10 14:31 | ||||||||||
Reporter | Laurent Demailly | ||||||||||||||
Assigned To | Kitware Robot | ||||||||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||||||||
Status | closed | Resolution | moved | ||||||||||||
Platform | Linux | OS | Ubuntu | OS Version | 14.04.1 | ||||||||||
Product Version | CMake 3.1 | ||||||||||||||
Target Version | Fixed in Version | ||||||||||||||
Summary | 0015361: CHECK_CXX_SOURCE_COMPILES doesn't use c++11 flags specified | ||||||||||||||
Description | I have set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED on) in my cmake file - yet later when I try: check_cxx_source_compiles( "extern \"C\" void cmkcheckweak() __attribute__((weak)); int main(int argc, char** argv) { return cmkcheckweak == nullptr; // works with (void*)0; }" HAVE_WEAK_SYMBOLS) it fails incorrectly because it invokes the compiler without the -std=gnu++11 it adds for regular files (the goal/point of CMAKE_CXX_STANDARD_REQUIRED is to use that compiler for everything and not me having to write code to guess the way to request c++11 compiler) this is related to http://public.kitware.com/Bug/view.php?id=15359 [^] but while here there is an easy work around (not use nullptr and use 0 instead) that won't work for other tests I'm trying to do with CHECK_CXX_SOURCE_COMPILES suggestions/workarounds on how to make CHECK_CXX_SOURCE_COMPILES use the same compiler invocation as my other targets would be most welcome in the meantime | ||||||||||||||
Steps To Reproduce | see above and below | ||||||||||||||
Additional Information | Performing C++ SOURCE FILE Test HAVE_WEAK_SYMBOLS failed with the following output: Change Dir: /home/ldemailly/mac/wdt_ubuntu_build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTryCompileExec1489303762/fast" /usr/bin/make -f CMakeFiles/cmTryCompileExec1489303762.dir/build.make CMakeFiles/cmTryCompileExec1489303762.dir/build make[1]: Entering directory `/mnt/hgfs/ldemailly/wdt_ubuntu_build/CMakeFiles/CMakeTmp' /usr/local/bin/cmake -E cmake_progress_report /home/ldemailly/mac/wdt_ubuntu_build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building CXX object CMakeFiles/cmTryCompileExec1489303762.dir/src.cxx.o /usr/bin/c++ -DHAVE_WEAK_SYMBOLS -o CMakeFiles/cmTryCompileExec1489303762.dir/src.cxx.o -c /home/ldemailly/mac/wdt_ubuntu_build/CMakeFiles/CMakeTmp/src.cxx /home/ldemailly/mac/wdt_ubuntu_build/CMakeFiles/CMakeTmp/src.cxx: In function ‘int main(int, char**)’: /home/ldemailly/mac/wdt_ubuntu_build/CMakeFiles/CMakeTmp/src.cxx:3:26: error: ‘nullptr’ was not declared in this scope return cmkcheckweak == nullptr; // (void*)0; works ^ make[1]: Leaving directory `/mnt/hgfs/ldemailly/wdt_ubuntu_build/CMakeFiles/CMakeTmp' make[1]: *** [CMakeFiles/cmTryCompileExec1489303762.dir/src.cxx.o] Error 1 make: *** [cmTryCompileExec1489303762/fast] Error 2 Source file was: extern "C" void cmkcheckweak() __attribute__((weak)); int main(int argc, char** argv) { return cmkcheckweak == nullptr; // (void*)0; works } | ||||||||||||||
Tags | No tags attached. | ||||||||||||||
Relationships |
| ||||||||||||||
Attached Files | |||||||||||||||
Issue History | |||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||
2015-01-19 18:28 | Laurent Demailly | New Issue | |||||||||||||
2015-01-19 20:05 | Laurent Demailly | Note Added: 0037755 | |||||||||||||
2015-01-20 08:31 | Brad King | Relationship added | related to 0015359 | ||||||||||||
2015-01-20 14:05 | Laurent Demailly | Note Added: 0037757 | |||||||||||||
2015-01-21 08:29 | Brad King | Note Added: 0037760 | |||||||||||||
2015-05-01 13:29 | Brad King | Relationship added | has duplicate 0015550 | ||||||||||||
2015-07-10 01:12 | Roman80 | Note Added: 0039119 | |||||||||||||
2015-08-17 20:02 | Laurent Demailly | Note Added: 0039292 | |||||||||||||
2015-08-17 20:24 | Laurent Demailly | Note Added: 0039293 | |||||||||||||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042701 | |||||||||||||
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 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|