| Issue |
60574
|
| Summary |
BUG: build_native_tool does not pass on CMAKE_CXX_STANDARD
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
h-vetinari
|
Trying to [build](https://github.com/conda-forge/mlir-feedstock/pull/32) mlir 16.0.0-rc1 in conda-forge, I'm running into the issue that MLIR now requires C++17 to build, but specifying `CMAKE_CXX_STANDARD` to the build does not get respected in cross-compilation.
>From what I can tell, this happens when invoking [`build_native_tool`](https://github.com/llvm/llvm-project/blob/llvmorg-16.0.0-rc1/llvm/cmake/modules/CrossCompile.cmake#L105), which then fails on any compiler that doesn't yet default to C++17.
```
[49/1416] Building native mlir-tblgen...
[1/47] Building CXX object tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/DirectiveCommonGen.cpp.o
FAILED: tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/DirectiveCommonGen.cpp.o
$BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang++ -DMLIR_CUDA_CONVERSIONS_ENABLED=1 -DMLIR_ROCM_CONVERSIONS_ENABLED=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I$SRC_DIR/build/NATIVE/tools/mlir-tblgen -I$SRC_DIR/mlir/tools/mlir-tblgen -I$SRC_DIR/mlir/include -I$SRC_DIR/build/NATIVE/include -isystem $BUILD_PREFIX/include -O2 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -Werror=mismatched-tags -O3 -DNDEBUG -isysroot /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=11.0 -fno-exceptions -MD -MT tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/DirectiveCommonGen.cpp.o -MF tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/DirectiveCommonGen.cpp.o.d -o tools/mlir-tblgen/CMakeFiles/mlir-tblgen.dir/DirectiveCommonGen.cpp.o -c $SRC_DIR/mlir/tools/mlir-tblgen/DirectiveCommonGen.cpp
In file included from $SRC_DIR/mlir/tools/mlir-tblgen/DirectiveCommonGen.cpp:14:
In file included from $SRC_DIR/mlir/include/mlir/TableGen/GenInfo.h:12:
In file included from $SRC_DIR/mlir/include/mlir/Support/LLVM.h:24:
$BUILD_PREFIX/include/llvm/Support/Casting.h:266:32: error: no member named 'optional' in namespace 'std'
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs