Commit e0c6ee3c authored by Michael Kuron's avatar Michael Kuron
Browse files

Detect std::variant from CMake

parent 85245fe6
......@@ -497,6 +497,12 @@ else()
endif()
endif()
try_compile( WALBERLA_USE_STD_VARIANT "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/TestStdVariant.cpp"
COMPILE_DEFINITIONS -DWALBERLA_USE_STD_VARIANT ${CMAKE_CXX14_STANDARD_COMPILE_OPTION} )
if( WALBERLA_USE_STD_VARIANT )
message( STATUS "Found std::variant")
endif()
############################################################################################################################
......
#include <iostream>
#include <variant>
int main() {
std::variant<int,float> a;
return 0;
}
......@@ -22,10 +22,6 @@
#pragma once
#if __cpp_lib_variant
#define WALBERLA_USE_STD_VARIANT
#endif
#if defined(WALBERLA_USE_STD_VARIANT)
#include <variant>
#else
......
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