Imported protoc cannot have compile options. (#5030)

This commit is contained in:
xkszltl 2020-09-04 06:20:00 +08:00 committed by GitHub
parent d7984fe6ba
commit 4b9b5b6146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()