Skip to content

Commit

Permalink
linking to .lib
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Jul 30, 2024
1 parent 93a4ac9 commit a460600
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)

# Set compiler options to support UTF-8 encoding
if(MSVC)
# Force compiler to use UTF-8 for IPA constants
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("/utf-8")
else()
add_compile_options("-finput-charset=UTF-8" "-fexec-charset=UTF-8")
endif()
Expand Down Expand Up @@ -79,8 +77,6 @@ else()
# Windows x86-64
set(ONNXRUNTIME_PREFIX "onnxruntime-win-x64-${ONNXRUNTIME_VERSION}")
set(ONNXRUNTIME_EXT "zip")

add_library(onnxruntime_providers SHARED IMPORTED)
elseif (APPLE)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
# MacOS x86-64
Expand Down Expand Up @@ -140,9 +136,6 @@ else()
# Import options for onnxruntime
if(WIN32)
set_target_properties(onnxruntime PROPERTIES IMPORTED_LOCATION ${BABYLON_LIB_INSTALL_DIR}/onnxruntime.dll)
set_target_properties(onnxruntime_providers PROPERTIES IMPORTED_LOCATION ${BABYLON_LIB_INSTALL_DIR}/onnxruntime_providers_shared.dll)

set_target_properties(onnxruntime PROPERTIES INTERFACE_LINK_LIBRARIES onnxruntime_providers)
elseif(APPLE)
set_target_properties(onnxruntime PROPERTIES IMPORTED_LOCATION ${BABYLON_LIB_INSTALL_DIR}/libonnxruntime.dylib)
else()
Expand All @@ -157,17 +150,24 @@ else()
)
endif()

if(APPLE)
link_directories(${BABYLON_LIB_INSTALL_DIR})

if(WIN32)
target_link_libraries(
babylon
${BABYLON_LIB_INSTALL_DIR}/onnxruntime.lib
)
elseif(APPLE)
target_link_libraries(
babylon
PUBLIC onnxruntime
onnxruntime
"-framework CoreFoundation"
"-framework Foundation"
)
else()
target_link_libraries(
babylon
PUBLIC onnxruntime
onnxruntime
)
endif()

Expand Down

0 comments on commit a460600

Please sign in to comment.