diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b59824069b..6cfae5ca37 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -791,7 +791,7 @@ function(onnxruntime_set_compile_flags target_name) endif() if (MSVC) foreach(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORY ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) - target_compile_options(${target_name} PRIVATE "$<$>:/external:I${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORY}>") + target_compile_options(${target_name} PRIVATE "$<$,$>:/external:I${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORY}>") endforeach() foreach(onnxruntime_external_lib IN LISTS onnxruntime_EXTERNAL_LIBRARIES) #TODO: the list contains cmake keywords like "debug". We should exclude them. @@ -802,11 +802,11 @@ function(onnxruntime_set_compile_flags target_name) if(onnxruntime_external_lib_include_dir MATCHES "^\\$]+)>$") string(REGEX REPLACE "^\\$]+)>$" "\\1" onnxruntime_external_lib_include_dir_cmake "${onnxruntime_external_lib_include_dir}") cmake_path(NATIVE_PATH onnxruntime_external_lib_include_dir_cmake NORMALIZE onnxruntime_external_lib_include_dir_native) - target_compile_options(${target_name} PRIVATE "$<$>:/external:I${onnxruntime_external_lib_include_dir_native}>") + target_compile_options(${target_name} PRIVATE "$<$,$>:/external:I${onnxruntime_external_lib_include_dir_native}>") endif() else() cmake_path(NATIVE_PATH onnxruntime_external_lib_include_dir NORMALIZE onnxruntime_external_lib_include_dir_native) - target_compile_options(${target_name} PRIVATE "$<$>:/external:I${onnxruntime_external_lib_include_dir_native}>") + target_compile_options(${target_name} PRIVATE "$<$,$>:/external:I${onnxruntime_external_lib_include_dir_native}>") endif() endforeach() endif() @@ -815,13 +815,13 @@ function(onnxruntime_set_compile_flags target_name) if (onnxruntime_ENABLE_MEMLEAK_CHECKER) target_compile_definitions(${target_name} PUBLIC -DONNXRUNTIME_ENABLE_MEMLEAK_CHECK) endif() - target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /utf-8>" "$<$>:/utf-8>") - target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /sdl>" "$<$>:/sdl>") + target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /utf-8>" "$<$,$>:/utf-8>") + target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /sdl>" "$<$,$>:/sdl>") set_target_properties(${target_name} PROPERTIES VS_GLOBAL_CAExcludePath "${ORT_BINARY_DIR};${ORT_SOURCE_DIR}") if (onnxruntime_ENABLE_STATIC_ANALYSIS) - target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /analyze>" "$<$>:/analyze>") - target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /analyze:external->" "$<$>:/analyze:external->") + target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /analyze>" "$<$,$>:/analyze>") + target_compile_options(${target_name} PRIVATE "$<$:SHELL:--compiler-options /analyze:external->" "$<$,$>:/analyze:external->") endif() else() # Enable warning diff --git a/cmake/onnxruntime_mlas.cmake b/cmake/onnxruntime_mlas.cmake index 09a97d880c..85c3501a02 100644 --- a/cmake/onnxruntime_mlas.cmake +++ b/cmake/onnxruntime_mlas.cmake @@ -582,9 +582,9 @@ foreach(mlas_target ${ONNXRUNTIME_MLAS_LIBS}) endforeach() set_target_properties(onnxruntime_mlas PROPERTIES FOLDER "ONNXRuntime") if (WIN32) - target_compile_options(onnxruntime_mlas PRIVATE "/wd6385" "/wd4127") + target_compile_options(onnxruntime_mlas PRIVATE "$<$:/wd6385>" "$<$:/wd4127>") if (onnxruntime_ENABLE_STATIC_ANALYSIS) - target_compile_options(onnxruntime_mlas PRIVATE "/analyze:stacksize 131072") + target_compile_options(onnxruntime_mlas PRIVATE "$<$:/analyze:stacksize 131072">) endif() endif()