[mlir] Specify CMAKE_CXX_STANDARD to standalone dialect
authorLei Zhang <antiagainst@google.com>
Tue, 5 May 2020 18:54:23 +0000 (14:54 -0400)
committerLei Zhang <antiagainst@google.com>
Tue, 5 May 2020 19:26:55 +0000 (15:26 -0400)
This addresses a compilation failure on GCC 5:

error: #error This file requires compiler and library support for the
ISO C++ 2011 standard. This support must be enabled with the -std=c++11
or -std=gnu++11 compiler options.
 #error This file requires compiler and library support

Differential Revision: https://reviews.llvm.org/D79439

mlir/examples/standalone/CMakeLists.txt

index d0514cb..fe309b5 100644 (file)
@@ -15,6 +15,8 @@ endif()
 
 project(standalone-dialect LANGUAGES CXX C)
 
+set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
+
 find_package(MLIR REQUIRED CONFIG)
 
 message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")