Skip to content

Commit 76d1c6c

Browse files
committed
Add cmake presets to configure cxx with MLIR enabled
Fixes #611 Signed-off-by: Roberto Raggi <[email protected]>
1 parent 211771d commit 76d1c6c

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

CMakePresets.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@
4343
"rhs": ""
4444
}
4545
},
46+
{
47+
"name": "default-mlir",
48+
"displayName": "default with MLIR",
49+
"inherits": "default",
50+
"cacheVariables": {
51+
"CXX_ENABLE_MLIR": "YES"
52+
}
53+
},
54+
{
55+
"name": "debug-mlir",
56+
"displayName": "debug with MLIR",
57+
"inherits": "debug",
58+
"cacheVariables": {
59+
"CXX_ENABLE_MLIR": "YES"
60+
}
61+
},
4662
{
4763
"name": "emscripten-mlir",
4864
"displayName": "emscripten with MLIR",

src/mlir/cxx/mlir/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ target_compile_definitions(cxx-mlir PUBLIC CXX_WITH_MLIR)
2626
add_dependencies(cxx-mlir MLIRCxxOpsIncGen)
2727

2828
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
29+
2930
target_compile_options(cxx-mlir PRIVATE
30-
-Wno-unused-variable
31-
-Wno-covered-switch-default
32-
-Wno-unused-but-set-variable
31+
$<$<COMPILE_LANGUAGE:CXX>:-Wno-all -Wno-extra -Wno-covered-switch-default>
3332
)
33+
3434
endif()

src/mlir/cxx/mlir/cxx_dialect.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@
2020

2121
#pragma once
2222

23+
#if defined(__clang__) || defined(__GNUC__)
24+
#pragma GCC diagnostic push
25+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
26+
#endif
27+
2328
#include <mlir/Bytecode/BytecodeOpInterface.h>
2429

30+
#if defined(__clang__) || defined(__GNUC__)
31+
#pragma GCC diagnostic pop
32+
#endif
33+
2534
#include <cxx/mlir/CxxOpsDialect.h.inc>
2635

2736
#define GET_TYPEDEF_CLASSES

0 commit comments

Comments
 (0)