From a1fe2caf9c186c15075dc07be2e1ebe999a4bc2c Mon Sep 17 00:00:00 2001 From: Xiake Sun Date: Mon, 6 Jan 2025 19:54:31 +0800 Subject: [PATCH 1/4] Specifies both the source character set and the execution character set as UTF-8. --- cmake/developer_package/compile_flags/os_flags.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index e75c6851ad0f7b..f6951c21fcd9af 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -455,6 +455,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Build with multiple processes ov_add_compiler_flags(/MP) + # Specifies both the source character set and the execution character set as UTF-8. + # For details, refer to link: https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170 + add_compile_options("$<$:/utf-8>") + # Workaround for an MSVC compiler issue in some versions of Visual Studio 2022. # The issue involves a null dereference to a mutex. For details, refer to link https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710 if(MSVC AND MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1941) From 36faefcc894e140a2eb00c2945f5d14bc2a77f8f Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 9 Jan 2025 12:46:16 +0400 Subject: [PATCH 2/4] Update cmake/developer_package/compile_flags/os_flags.cmake --- cmake/developer_package/compile_flags/os_flags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index c09b6221310ef4..10cffe002665c8 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -451,7 +451,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Specifies both the source character set and the execution character set as UTF-8. # For details, refer to link: https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170 - add_compile_options("$<$:/utf-8>") + ov_add_compiler_flags($<$:/utf-8>) # Workaround for an MSVC compiler issue in some versions of Visual Studio 2022. # The issue involves a null dereference to a mutex. For details, refer to link https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710 From c5ee97d1e790816cc7d0479f84d18b2506e03f5e Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 9 Jan 2025 12:56:55 +0400 Subject: [PATCH 3/4] Update cmake/developer_package/compile_flags/os_flags.cmake --- cmake/developer_package/compile_flags/os_flags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index 10cffe002665c8..b928da57445e38 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -451,7 +451,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Specifies both the source character set and the execution character set as UTF-8. # For details, refer to link: https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170 - ov_add_compiler_flags($<$:/utf-8>) + ov_add_compiler_flags("$<$:/utf-8>") # Workaround for an MSVC compiler issue in some versions of Visual Studio 2022. # The issue involves a null dereference to a mutex. For details, refer to link https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710 From f23b4eccc2d157e6c0488545fd3d3c407fd000b6 Mon Sep 17 00:00:00 2001 From: Xiake Sun Date: Thu, 9 Jan 2025 20:48:13 +0800 Subject: [PATCH 4/4] Use ov_add_compiler_flags to limit compiler flag in openvino scope --- cmake/developer_package/compile_flags/os_flags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index b928da57445e38..7c50f6f6e7eb6b 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -451,7 +451,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Specifies both the source character set and the execution character set as UTF-8. # For details, refer to link: https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170 - ov_add_compiler_flags("$<$:/utf-8>") + ov_add_compiler_flags(/utf-8) # Workaround for an MSVC compiler issue in some versions of Visual Studio 2022. # The issue involves a null dereference to a mutex. For details, refer to link https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710