MAKEFLAGS breaks C++11 feature check during bootstrap
export MAKEFLAGS=-j8
breaks cmake's bootstrap, which says
-- Checking if compiler supports C++ unique_ptr - no
CMake Error at CMakeLists.txt:92 (message):
The C++ compiler does not support C++11 (e.g. std::unique_ptr).
Yes this looks completely unrelated, hold on, it will make sense. The actual output from the try_compile is
Run Build Command:"/home/dfaure/bin/gmake" "cmTC_60a44/fast"
gmake -f CMakeFiles/cmTC_60a44.dir/build.make CMakeFiles/cmTC_60a44.dir/build
gmake[1]: warning: -jN forced in submake: disabling jobserver mode.
gmake[1]: Entering directory '/d/kde/build/5/cmake-git/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_60a44.dir/cm_cxx_unique_ptr.cxx.o
/home/dfaure/bin/g++ -std=gnu++1z -o CMakeFiles/cmTC_60a44.dir/cm_cxx_unique_ptr.cxx.o -c /d/kde/src/5/cmake-git/Source/Checks/cm_cxx_unique_ptr.cxx
Linking CXX executable cmTC_60a44
/d/kde/build/5/cmake-git/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_60a44.dir/link.txt --verbose=1
/home/dfaure/bin/g++ -rdynamic CMakeFiles/cmTC_60a44.dir/cm_cxx_unique_ptr.cxx.o -o cmTC_60a44
gmake[1]: Leaving directory '/d/kde/build/5/cmake-git/CMakeFiles/CMakeTmp'
Notice how the third line has a gmake warning (due to gmake -f
being called instead of $(MAKE) -f
).
This triggers the following code in Source/Checks/cm_cxx_features.cmake:
# If using the feature causes warnings, treat it as broken/unavailable.
if(check_output MATCHES "[Ww]arning")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
endif()
So the make warning is treated as a compiler warning ;-)
I've been trying to find the "proper" fix for this ($(MAKE) instead of gmake), but I can't find where that comes from. Source/cmLocalUnixMakefileGenerator3.cxx does say $(MAKE)...
Version: cmake git, release branch. git describe says v3.11.0-rc2
.
Edited by Craig Scott