This is an automated email from the ASF dual-hosted git repository. syfeng pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push: new 2b6b9e442d [CMake] Refine C++/CUDA standard settings in CMakeLists.txt (#18113) 2b6b9e442d is described below commit 2b6b9e442d3baa8e80f267c5a17d9d5be06b7648 Author: Twice <tw...@apache.org> AuthorDate: Fri Jul 4 22:36:16 2025 +0800 [CMake] Refine C++/CUDA standard settings in CMakeLists.txt (#18113) [CMake] Refine c++/cuda standard settings in CMakeLists.txt --- CMakeLists.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3667ed6ba9..4e96a7b159 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -448,15 +448,10 @@ endif(USE_KALLOC_ALIGNMENT) include(cmake/utils/CCache.cmake) include(CheckCXXCompilerFlag) -if(NOT MSVC) - check_cxx_compiler_flag("-std=c++17" SUPPORT_CXX17) - set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}") - set(CMAKE_CUDA_STANDARD 17) -else() - check_cxx_compiler_flag("/std:c++17" SUPPORT_CXX17) - set(CMAKE_CXX_FLAGS "/std:c++17 ${CMAKE_CXX_FLAGS}") - set(CMAKE_CUDA_STANDARD 17) -endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CUDA_STANDARD_REQUIRED ON) +set(CMAKE_CUDA_STANDARD 17) # Module rules include(cmake/modules/CUDA.cmake)