From 4b9b5b6146dfae96799a05c44c8d4d05e3fc97ca Mon Sep 17 00:00:00 2001 From: xkszltl Date: Fri, 4 Sep 2020 06:20:00 +0800 Subject: [PATCH] Imported protoc cannot have compile options. (#5030) --- cmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b0f4ab5ab7..7c85de67e3 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -504,7 +504,7 @@ else() endif() endif() -if(UNIX AND onnxruntime_ENABLE_LTO) +if(UNIX AND onnxruntime_ENABLE_LTO AND NOT onnxruntime_PREFER_SYSTEM_LIB) #https://github.com/protocolbuffers/protobuf/issues/5923 target_link_options(protoc PRIVATE "-Wl,--no-as-needed") endif()