diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-08-04 10:49:16 +0200 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-20 10:01:37 -0400 |
commit | c688b401d3adaacc820ef4b589010e8aefa808b1 (patch) | |
tree | 83e46e3dc7c9847692e61d0e6629b1cf9b65d2a5 /bootstrap | |
parent | 9c31d83aa2a3d3f5921f4a5a559e126e285b96c5 (diff) | |
download | cmake-c688b401d3adaacc820ef4b589010e8aefa808b1.tar.gz |
cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes: #19491
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -453,7 +453,6 @@ CMAKE_CXX_SOURCES="\ cmake \ cmakemain \ cmcmd \ - cm_string_view \ " if ${cmake_system_mingw}; then @@ -464,6 +463,17 @@ if ${cmake_system_mingw}; then " fi +CMAKE_STD_CXX_HEADERS="\ + memory \ + optional \ + shared_mutex \ + string_view \ + utility \ +" +CMAKE_STD_CXX_SOURCES="\ + string_view \ +" + LexerParser_CXX_SOURCES="\ cmCommandArgumentLexer \ cmCommandArgumentParser \ @@ -1346,6 +1356,8 @@ cmake_compiler_settings_comment="/* * * Sources: * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} + * STD Sources: + * ${CMAKE_STD_CXX_HEADERS} ${CMAKE_STD_CXX_SOURCES} * LexerParser Sources: * ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} * kwSys Sources: @@ -1412,9 +1424,12 @@ done cmake_generate_file "${cmake_bootstrap_dir}/cmThirdParty.h" "" # Generate Makefile -dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h" +dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.hxx `cmake_escape \"${cmake_source_dir}\"`/Source/*.h" +for h in ${CMAKE_STD_CXX_HEADERS}; do + dep="${dep} `cmake_escape \"${cmake_source_dir}\"`/Utilities/std/cm/${h}" +done objs="" -for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do +for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${CMAKE_STD_CXX_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do objs="${objs} ${a}.o" done for a in ${LIBUV_C_SOURCES}; do @@ -1498,6 +1513,7 @@ cmake_cxx_flags="${cmake_cxx_flags} \ -I`cmake_escape \"${cmake_bootstrap_dir}\"` \ -I`cmake_escape \"${cmake_source_dir}/Source\"` \ -I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \ + -I`cmake_escape \"${cmake_source_dir}/Utilities/std\"` \ -I`cmake_escape \"${cmake_source_dir}/Utilities\"`" echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile" echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} ${libs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile" @@ -1512,6 +1528,12 @@ for a in ${CMAKE_C_SOURCES}; do echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile" echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile" done +for a in ${CMAKE_STD_CXX_SOURCES}; do + src=`cmake_escape "${cmake_source_dir}/Utilities/std/cm/bits/${a}.cxx"` + src_flags=`eval echo \\${cmake_cxx_flags_\${a}}` + echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile" + echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile" +done for a in ${LexerParser_CXX_SOURCES}; do src=`cmake_escape "${cmake_source_dir}/Source/LexerParser/${a}.cxx"` src_flags=`eval echo \\${cmake_cxx_flags_\${a}}` |