Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ endif()


set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} ${WIL_TARGET} nlohmann_json::nlohmann_json
onnx onnx_proto ${PROTOBUF_LIB} re2::re2 Boost::mp11 safeint_interface
onnx ${PROTOBUF_LIB} re2::re2 Boost::mp11 safeint_interface
flatbuffers::flatbuffers ${GSL_TARGET} ${ABSEIL_LIBS} date::date
${ONNXRUNTIME_CPUINFO_TARGETS} Eigen3::Eigen)

Expand Down
9 changes: 3 additions & 6 deletions recipes/onnxruntime/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
Expand Down Expand Up @@ -81,10 +80,6 @@ def validate(self):
raise ConanInvalidConfiguration(
f"{self.ref} requires onnx compiled with `-o onnx:disable_static_registration=True`."
)
if onnx.options.get_safe("shared"):
# Commented here: https://github.com/onnx/onnx/pull/7505#issuecomment-3601468150
raise ConanInvalidConfiguration("There are link errors using 'onnx/*:shared=True',"
" use '-o onnx/*:shared=False' instead.")

def validate_build(self):
if self.settings.os == "Windows" and self.dependencies["abseil"].options.shared:
Expand All @@ -102,7 +97,9 @@ def generate(self):
tc = CMakeToolchain(self)
# disable downloading dependencies to ensure conan ones are used
tc.variables["FETCHCONTENT_FULLY_DISCONNECTED"] = True

if self.options.shared:
import sys
tc.variables["Python_EXECUTABLE"] = sys.executable.replace("\\", "/")
tc.variables["onnxruntime_BUILD_SHARED_LIB"] = self.options.shared
tc.variables["onnxruntime_USE_FULL_PROTOBUF"] = not self.dependencies["protobuf"].options.lite
tc.variables["onnxruntime_USE_XNNPACK"] = self.options.with_xnnpack
Expand Down