summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap39
1 files changed, 38 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index 1f8eaa5..d529f3b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -294,6 +294,7 @@ CMAKE_CXX_SOURCES="\
cmCreateTestSourceList \
cmCustomCommand \
cmCustomCommandGenerator \
+ cmCustomCommandLines \
cmDefinePropertyCommand \
cmDefinitions \
cmDepends \
@@ -372,6 +373,7 @@ CMAKE_CXX_SOURCES="\
cmLDConfigTool \
cmLinkDirectoriesCommand \
cmLinkItem \
+ cmLinkItemGraphVisitor \
cmLinkLineComputer \
cmLinkLineDeviceComputer \
cmListCommand \
@@ -1166,10 +1168,20 @@ int check_cxx14()
}
#endif
-#if __cplusplus >= 201703L
+#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_if_constexpr))
#include <optional>
+template <typename T,
+ typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
+typename T::pointer get_ptr(T& item)
+{
+ return item.get();
+}
+
int check_cxx17()
{
+ // Intel compiler do not handle correctly 'decltype' inside 'invoke_result'
+ std::unique_ptr<int> u(new int(0));
+ get_ptr(u);
std::optional<int> oi = 0;
return oi.value();
}
@@ -1222,6 +1234,29 @@ fi
echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
#-----------------------------------------------------------------------------
+# Test CXX features
+
+cmake_cxx_features="make_unique"
+
+for feature in ${cmake_cxx_features}; do
+ eval "cmake_have_cxx_${feature}=0"
+ echo "Checking whether '${cmake_cxx_compiler} ${cmake_cxx_flags}' supports '${feature}'." >> cmake_bootstrap.log 2>&1
+ if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" \
+ "${cmake_source_dir}/Source/Checks/cm_cxx_${feature}.cxx" >> cmake_bootstrap.log 2>&1; then
+ eval "cmake_have_cxx_${feature}=1"
+ fi
+done
+
+cmake_have_cxx_features=""
+for feature in ${cmake_cxx_features}; do
+ feature_variable="cmake_have_cxx_${feature}"
+ eval "feature_value=\${${feature_variable}}"
+ if [ "${feature_value}" -eq "1" ]; then
+ cmake_have_cxx_features="${cmake_have_cxx_features} -DCMake_HAVE_CXX_`cmake_toupper ${feature}`=${feature_value}"
+ fi
+done
+
+#-----------------------------------------------------------------------------
# Test Make
cmake_make_processor=
@@ -1522,6 +1557,7 @@ cmake_c_flags="${cmake_c_flags} \
-I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
cmake_cxx_flags="${cmake_cxx_flags} \
-DCMAKE_BOOTSTRAP \
+ ${cmake_have_cxx_features} \
-I`cmake_escape \"${cmake_bootstrap_dir}\"` \
-I`cmake_escape \"${cmake_source_dir}/Source\"` \
-I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \
@@ -1583,6 +1619,7 @@ rebuild_cache:
echo '
# Generated by '"${cmake_source_dir}"'/bootstrap
# Default cmake settings. These may be overridden any settings below.
+set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build.") # not FORCE to preserve defaults specified elsewhere
set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)