mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Fix a build issue when statically link to MSVC Runtime (#22393)
Yesterday I updated ABSL to a newer version which added a new cmake option: ABSL_MSVC_STATIC_RUNTIME . I wasn't aware of it. This PR fixes it.
This commit is contained in:
parent
b4fb32d80d
commit
6ada97c84c
1 changed files with 3 additions and 0 deletions
|
|
@ -1177,11 +1177,14 @@ def generate_build_tree(
|
|||
)
|
||||
add_default_definition(cmake_extra_defines, "ONNX_USE_MSVC_STATIC_RUNTIME", "ON")
|
||||
add_default_definition(cmake_extra_defines, "protobuf_MSVC_STATIC_RUNTIME", "ON")
|
||||
# The following build option was added in ABSL 20240722.0 and it must be explicitly set
|
||||
add_default_definition(cmake_extra_defines, "ABSL_MSVC_STATIC_RUNTIME", "ON")
|
||||
add_default_definition(cmake_extra_defines, "gtest_force_shared_crt", "OFF")
|
||||
else:
|
||||
# CMAKE_MSVC_RUNTIME_LIBRARY is default to MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
|
||||
add_default_definition(cmake_extra_defines, "ONNX_USE_MSVC_STATIC_RUNTIME", "OFF")
|
||||
add_default_definition(cmake_extra_defines, "protobuf_MSVC_STATIC_RUNTIME", "OFF")
|
||||
add_default_definition(cmake_extra_defines, "ABSL_MSVC_STATIC_RUNTIME", "OFF")
|
||||
add_default_definition(cmake_extra_defines, "gtest_force_shared_crt", "ON")
|
||||
|
||||
if acl_home and os.path.exists(acl_home):
|
||||
|
|
|
|||
Loading…
Reference in a new issue