Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DEPENDENTLOAD flag to vc linker on Windows #2896

Merged
merged 5 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading