Skip to content

Commit

Permalink
Add DEPENDENTLOAD flag to vc linker on Windows (#2896)
Browse files Browse the repository at this point in the history
  • Loading branch information
olegkkruglov authored Sep 17, 2024
1 parent c27a8fc commit 00dacc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/make/compiler_definitions/vc.mkl.32e.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ CORE.SERV.COMPILER.vc = generic
# Disable C4661 because of false positives
COMPILER.win.vc = cl $(if $(MSVC_RT_is_release),-MD, -MDd) -nologo -EHsc -wd4661 -WX

link.dynamic.win.vc = /DEPENDENTLOADFLAG:0x2000

p4_OPT.vc =
mc3_OPT.vc =
avx2_OPT.vc = -arch:AVX2
Expand Down
3 changes: 3 additions & 0 deletions examples/cmake/setup_examples.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ function (add_examples examples_paths)
endif()
target_compile_options(${example} PRIVATE ${ONEDAL_CUSTOM_COMPILE_OPTIONS})
target_link_options(${example} PRIVATE ${ONEDAL_CUSTOM_LINK_OPTIONS})
if(WIN32 AND "${ONEDAL_LINK}" STREQUAL "dynamic" AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC|IntelLLVM")
target_link_options(${example} PRIVATE /DEPENDENTLOADFLAG:0x2000)
endif()
set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/_cmake_results/${CPU_ARCHITECTURE}_${LINK_TYPE}")
endforeach()
set_common_compiler_options()
Expand Down
3 changes: 3 additions & 0 deletions samples/cmake/setup_samples.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ function(add_samples samples_paths)

target_compile_options(${sample} PRIVATE ${ONEDAL_CUSTOM_COMPILE_OPTIONS})
target_link_options(${sample} PRIVATE ${ONEDAL_CUSTOM_LINK_OPTIONS})
if(WIN32 AND "${ONEDAL_LINK}" STREQUAL "dynamic" AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC|IntelLLVM")
target_link_options(${sample} PRIVATE /DEPENDENTLOADFLAG:0x2000)
endif()
set_target_properties(${sample} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/_cmake_results/${CPU_ARCHITECTURE}_${LINK_TYPE}")

add_custom_target(run_${sample}
Expand Down

0 comments on commit 00dacc9

Please sign in to comment.