diff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.yml index 24503a52878f88..592653bc42a19e 100644 --- a/.github/workflows/job_build_windows.yml +++ b/.github/workflows/job_build_windows.yml @@ -45,6 +45,7 @@ jobs: ARTIFACTS_SHARE: "C:\\mount\\build-artifacts" MANIFEST_PATH: "${{ github.workspace }}\\manifest.yml" PRODUCT_TYPE: 'public_windows_vs2019_${{ inputs.build-type }}' + CMAKE_TOOLCHAIN_FILE: "${{ github.workspace }}\\openvino\\cmake\\toolchains\\mt.runtime.win32.toolchain.cmake" steps: - name: Clone OpenVINO uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 diff --git a/.github/workflows/windows_conditional_compilation.yml b/.github/workflows/windows_conditional_compilation.yml index c382795854b030..36373efa71977b 100644 --- a/.github/workflows/windows_conditional_compilation.yml +++ b/.github/workflows/windows_conditional_compilation.yml @@ -67,6 +67,7 @@ jobs: BUILD_DIR: "${{ github.workspace }}\\openvino_build" MODELS_PATH: "${{ github.workspace }}\\testdata" SELECTIVE_BUILD_STAT_DIR: "${{ github.workspace }}\\selective_build_stat" + CMAKE_TOOLCHAIN_FILE: "${{ github.workspace }}\\openvino\\cmake\\toolchains\\mt.runtime.win32.toolchain.cmake" # TODO: specify version of compiler here if: ${{ !needs.smart_ci.outputs.skip_workflow && github.event_name != 'merge_group' }} diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index a152ff85c9c768..a7e443b5ed7db1 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -101,12 +101,21 @@ function(ov_download_tbb) if(WIN32 AND X86_64) # TODO: add target_path to be platform specific as well, to avoid following if # build oneTBB 2021.2.1 with Visual Studio 2019 (MSVC 14.21) - RESOLVE_DEPENDENCY(TBB - ARCHIVE_WIN "oneapi-tbb-2021.2.5-win-trim.zip" - TARGET_PATH "${TEMP}/tbb" - ENVIRONMENT "TBBROOT" - SHA256 "a9384a25861946648db58f7f294c4aa2b1be7ae52748024fef3e13ca2762a1ba" - USE_NEW_LOCATION TRUE) + if (TBB_STATIC_CRT) + RESOLVE_DEPENDENCY(TBB + ARCHIVE_WIN "oneapi-tbb-2021.2.5-win-vcruntime.zip" + TARGET_PATH "${TEMP}/tbb" + ENVIRONMENT "TBBROOT" + SHA256 "dc6d5caed18fe4a30e088d1e45f92aac8fa10f542d19019edafa6aeea4465551" + USE_NEW_LOCATION TRUE) + else() + RESOLVE_DEPENDENCY(TBB + ARCHIVE_WIN "oneapi-tbb-2021.2.5-win-trim-cfg-simplify.zip" + TARGET_PATH "${TEMP}/tbb" + ENVIRONMENT "TBBROOT" + SHA256 "63bf0992406d69dfb3c402f46466face2388ca55b6678f29072ba304f3622fe7" + USE_NEW_LOCATION TRUE) + endif() elseif(ANDROID AND X86_64) RESOLVE_DEPENDENCY(TBB ARCHIVE_ANDROID "tbb2020_20200404_android.tgz" diff --git a/cmake/toolchains/mt.runtime.win32.toolchain.cmake b/cmake/toolchains/mt.runtime.win32.toolchain.cmake index d23b79570b190b..fcb2e88e4064b0 100644 --- a/cmake/toolchains/mt.runtime.win32.toolchain.cmake +++ b/cmake/toolchains/mt.runtime.win32.toolchain.cmake @@ -26,15 +26,19 @@ if(use_static_runtime) foreach(lang C CXX) foreach(build_type "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO") set(flag_var "CMAKE_${lang}_FLAGS${build_type}_INIT") - set(flag_var_noninit "CMAKE_${lang}_FLAGS${build_type}") string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endforeach() + endforeach() + foreach(type EXE SHARED MODULE) + foreach(build_type "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO") + set(flag_var "CMAKE_${type}_LINKER_FLAGS${build_type}_INIT") if (build_type STREQUAL "_DEBUG") - set(${flag_var_noninit} "${${flag_var_noninit}} /MTd") + string(APPEND ${flag_var} " /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib") else() - set(${flag_var_noninit} "${${flag_var_noninit}} /MT") + string(APPEND ${flag_var} " /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib") endif() endforeach() - endforeach() + endforeach() endif() macro(ov_set_msvc_runtime var value) @@ -58,6 +62,8 @@ ov_set_msvc_runtime(CLDNN__COMPILE_LINK_USE_STATIC_RUNTIME ${use_static_runtime} ov_set_msvc_runtime(USE_DYNAMIC_VCXX_RUNTIME ${use_dynamic_runtime}) # google-test ov_set_msvc_runtime(gtest_force_shared_crt ${use_dynamic_runtime}) +# tbb package +ov_set_msvc_runtime(TBB_STATIC_CRT ${use_static_runtime}) unset(use_static_runtime) -unset(use_dynamic_runtime) +unset(use_dynamic_runtime) \ No newline at end of file