Commit 5286110d authored by Daniel Pfeifer's avatar Daniel Pfeifer Committed by Brad King
Browse files

cxx features: add check for override

parent 09aa2c94
......@@ -32,6 +32,7 @@ function(cm_check_cxx_feature name)
endfunction()
if(CMAKE_CXX_STANDARD)
cm_check_cxx_feature(override)
cm_check_cxx_feature(unordered_map)
cm_check_cxx_feature(unordered_set)
endif()
struct Foo
{
virtual int test() const = 0;
};
struct Bar : Foo
{
int test() const override { return 0; }
};
int test(Foo const& foo)
{
return foo.test();
}
int main()
{
Bar const bar;
return test(bar);
}
......@@ -29,9 +29,16 @@
#cmakedefine CMAKE_USE_ELF_PARSER
#cmakedefine CMAKE_USE_MACH_PARSER
#cmakedefine CMAKE_ENCODING_UTF8
#cmakedefine CMake_HAVE_CXX_OVERRIDE
#cmakedefine CMake_HAVE_CXX_UNORDERED_MAP
#cmakedefine CMake_HAVE_CXX_UNORDERED_SET
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
#ifdef CMake_HAVE_CXX_OVERRIDE
#define CM_OVERRIDE override
#else
#define CM_OVERRIDE
#endif
#endif
......@@ -1272,6 +1272,7 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE"
# Regenerate configured headers
for h in Configure VersionConfig; do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment