diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index e9dc313861..4605d0d08e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -984,7 +984,7 @@ function(onnxruntime_set_compile_flags target_name) target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options -Wno-deprecated-copy>" "$<$:-Wno-deprecated-copy>") endif() if(onnxruntime_USE_CUDA) - if(HAS_STRICT_ALIASING AND ${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL "11.0.0") + if(HAS_STRICT_ALIASING) target_compile_options(${target_name} PRIVATE "$<$:-Wno-strict-aliasing>") endif() endif()