From 3d0a9ec08fdd13bbff94b02698d5a7283bdad843 Mon Sep 17 00:00:00 2001 From: Khatavkar Date: Wed, 20 Dec 2023 11:16:27 -0800 Subject: [PATCH 1/2] [UR] add dependent-load flag to exclude CWD from default search path for DLLs --- source/adapters/level_zero/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/adapters/level_zero/CMakeLists.txt b/source/adapters/level_zero/CMakeLists.txt index 7203d5a238..fa93cde2b9 100644 --- a/source/adapters/level_zero/CMakeLists.txt +++ b/source/adapters/level_zero/CMakeLists.txt @@ -132,6 +132,10 @@ set_target_properties(${TARGET_NAME} PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" ) +if (WIN32) + target_link_options(ur_adapter_level_zero PUBLIC /DEPENDENTLOADFLAG:0x800) +endif() + target_link_libraries(${TARGET_NAME} PRIVATE ${PROJECT_NAME}::headers ${PROJECT_NAME}::common From 0e37380e7a180431fa968fe1826cc5bbf15a3a5a Mon Sep 17 00:00:00 2001 From: Khatavkar Date: Thu, 21 Dec 2023 08:24:53 -0800 Subject: [PATCH 2/2] add a comment --- source/adapters/level_zero/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/adapters/level_zero/CMakeLists.txt b/source/adapters/level_zero/CMakeLists.txt index fa93cde2b9..9b94d4ac0e 100644 --- a/source/adapters/level_zero/CMakeLists.txt +++ b/source/adapters/level_zero/CMakeLists.txt @@ -133,6 +133,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES ) if (WIN32) + # 0x800: Search for the DLL only in the System32 folder target_link_options(ur_adapter_level_zero PUBLIC /DEPENDENTLOADFLAG:0x800) endif()