Skip to content

Commit

Permalink
Refactor CMakeLists.txt to adjust library linking and update build sc…
Browse files Browse the repository at this point in the history
…ript for configurable installation
  • Loading branch information
royshil committed Nov 5, 2024
1 parent c89c4cf commit 4e80a23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ target_include_directories(moonshine
${ONNXRUNTIME_INCLUDE_DIRS}
)

target_link_libraries(moonshine PUBLIC Ort nlohmann_json::nlohmann_json)
target_link_libraries(moonshine PUBLIC nlohmann_json::nlohmann_json)
target_link_libraries(moonshine INTERFACE Ort)

# Create example executable
add_executable(moonshine_example examples/demo.cpp)
Expand Down
5 changes: 0 additions & 5 deletions cmake/FetchOnnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ if(APPLE)
target_sources(Ort PRIVATE "${Onnxruntime_LIB}")
set_property(SOURCE "${Onnxruntime_LIB}" PROPERTY MACOSX_PACKAGE_LOCATION Frameworks)
source_group("Frameworks" FILES "${Onnxruntime_LIB}")
# # add a codesigning step
# add_custom_command(
# TARGET "${CMAKE_PROJECT_NAME}"
# PRE_BUILD VERBATIM
# COMMAND /usr/bin/codesign --force --verify --verbose --sign "${CODESIGN_IDENTITY}" "${Onnxruntime_LIB}")
add_custom_command(
TARGET Ort
POST_BUILD
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ if ($LASTEXITCODE -eq 0) {
}

# Install to current directory
cmake --install "$ROOT_DIR/build" --prefix "$ROOT_DIR/dist"
cmake --install "$ROOT_DIR/build" --prefix "$ROOT_DIR/dist" --config $BuildType

0 comments on commit 4e80a23

Please sign in to comment.