From fb30e9fdae53c6ca0d4068a5f0656205e953611d Mon Sep 17 00:00:00 2001 From: Patrik Vavercak <56153264+pvavercak@users.noreply.github.com> Date: Wed, 8 Dec 2021 20:44:00 +0100 Subject: [PATCH] Remove /safeseh link option from non-msvc builds (#9744) (#9935) --- cmake/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c447093f9f..7a43d53c3e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1228,7 +1228,7 @@ function(onnxruntime_add_shared_library_module target_name) endif() onnxruntime_configure_target(${target_name}) - if (onnxruntime_target_platform STREQUAL "x86" AND NOT onnxruntime_BUILD_WEBASSEMBLY) + if (MSVC AND onnxruntime_target_platform STREQUAL "x86" AND NOT onnxruntime_BUILD_WEBASSEMBLY) target_link_options(${target_name} PRIVATE /SAFESEH) endif() endfunction() @@ -1236,7 +1236,7 @@ endfunction() function(onnxruntime_add_executable target_name) add_executable(${target_name} ${ARGN}) onnxruntime_configure_target(${target_name}) - if (onnxruntime_target_platform STREQUAL "x86" AND NOT onnxruntime_BUILD_WEBASSEMBLY) + if (MSVC AND onnxruntime_target_platform STREQUAL "x86" AND NOT onnxruntime_BUILD_WEBASSEMBLY) target_link_options(${target_name} PRIVATE /SAFESEH) endif() endfunction()