diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 29ba0e0..485267e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,32 +26,37 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Run Build Script Windows if: matrix.os == 'windows-latest' - working-directory: ${{runner.workspace}} - run: ./scripts/build-windows.ps1 + working-directory: ${{runner.workspace}}/locaal-sdk + run: ./scripts/build-windows.ps1 -Clean shell: pwsh - name: Run Build Script Linux and MacOS if: matrix.os != 'windows-latest' - working-directory: ${{runner.workspace}} - run: ./scripts/build-nix.sh + working-directory: ${{runner.workspace}}/locaal-sdk + run: ./scripts/build-nix.sh --clean shell: bash - - name: Package - working-directory: ${{runner.workspace}}/build + - name: Package Windows + if: matrix.os == 'windows-latest' + working-directory: ${{runner.workspace}}/locaal-sdk + run: | + cmake --install ./build_x64 --prefix installed + 7z a ${{ matrix.os }}-package.zip ./installed/* + + - name: Package Linux and MacOS + if: matrix.os == 'windows-latest' + working-directory: ${{runner.workspace}}/locaal-sdk run: | - cmake --install . --prefix installed + cmake --install ./build --prefix installed 7z a ${{ matrix.os }}-package.zip ./installed/* - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-package - path: ${{runner.workspace}}/build/${{ matrix.os }}-package.zip + path: ${{runner.workspace}}/locaal-sdk/${{ matrix.os }}-package.zip release: needs: build diff --git a/.gitignore b/.gitignore index 7b8729b..80af05d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ # CMake build directory build/ build_x64/ +installed/ # CMake generated files CMakeCache.txt diff --git a/cmake/BuildICU.cmake b/cmake/BuildICU.cmake index 3160bc8..f5c5f32 100644 --- a/cmake/BuildICU.cmake +++ b/cmake/BuildICU.cmake @@ -42,7 +42,7 @@ if(WIN32) PATHS ${ICU_BINARY_DIR} NO_DEFAULT_PATH) # Copy the DLLs to the output directory - install(FILES ${ICU_DLL_${lib}} DESTINATION "obs-plugins/64bit") + install(FILES ${ICU_DLL_${lib}} DESTINATION "bin") # add the library add_library(ICU::${lib} SHARED IMPORTED GLOBAL) set_target_properties(ICU::${lib} PROPERTIES IMPORTED_LOCATION "${ICU_LIB_${lib}}" IMPORTED_IMPLIB diff --git a/cmake/BuildSentencepiece.cmake b/cmake/BuildSentencepiece.cmake index 29e57bc..66888d5 100644 --- a/cmake/BuildSentencepiece.cmake +++ b/cmake/BuildSentencepiece.cmake @@ -1,5 +1,7 @@ # build sentencepiece from "https://github.com/google/sentencepiece.git" +set(SENTENCEPIECE_INSTALL_LIB_LOCATION lib/${CMAKE_STATIC_LIBRARY_PREFIX}sentencepiece${CMAKE_STATIC_LIBRARY_SUFFIX}) + if(APPLE) include(FetchContent) @@ -28,7 +30,7 @@ elseif(WIN32) $ $ ) - + else() set(SP_URL @@ -36,7 +38,6 @@ else() CACHE STRING "URL of sentencepiece repository") set(SP_CMAKE_OPTIONS -DSPM_ENABLE_SHARED=OFF) - set(SENTENCEPIECE_INSTALL_LIB_LOCATION lib/${CMAKE_STATIC_LIBRARY_PREFIX}sentencepiece${CMAKE_STATIC_LIBRARY_SUFFIX}) include(ExternalProject) @@ -67,4 +68,4 @@ endif() # add exported target install install(TARGETS sentencepiece EXPORT sentencepiece-targets) install(EXPORT sentencepiece-targets NAMESPACE sentencepiece:: DESTINATION lib/cmake/sentencepiece) -install(FILES ${sentencepiece_fetch_SOURCE_DIR}/lib/libsentencepiece.a DESTINATION "bin") +install(FILES ${sentencepiece_fetch_SOURCE_DIR}/${SENTENCEPIECE_INSTALL_LIB_LOCATION} DESTINATION "bin") diff --git a/cmake/BuildWhispercpp.cmake b/cmake/BuildWhispercpp.cmake index a936d49..ab9321c 100644 --- a/cmake/BuildWhispercpp.cmake +++ b/cmake/BuildWhispercpp.cmake @@ -97,7 +97,7 @@ elseif(WIN32) # glob all dlls in the bin directory and install them file(GLOB WHISPER_DLLS ${whispercpp_fetch_SOURCE_DIR}/bin/*.dll) - install(FILES ${WHISPER_DLLS} DESTINATION "obs-plugins/64bit") + install(FILES ${WHISPER_DLLS} DESTINATION "bin") else() if(${CMAKE_BUILD_TYPE} STREQUAL Release OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo) set(Whispercpp_BUILD_TYPE Release) @@ -156,5 +156,7 @@ install(FILES ${whispercpp_fetch_SOURCE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}w DESTINATION "bin") install(FILES ${whispercpp_fetch_SOURCE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ggml${CMAKE_STATIC_LIBRARY_SUFFIX} DESTINATION "bin") -install(FILES ${whispercpp_fetch_SOURCE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}whisper.coreml${CMAKE_STATIC_LIBRARY_SUFFIX} - DESTINATION "bin") +if(APPLE) + install(FILES ${whispercpp_fetch_SOURCE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}whisper.coreml${CMAKE_STATIC_LIBRARY_SUFFIX} + DESTINATION "bin") +endif(APPLE) diff --git a/cmake/FetchOnnxruntime.cmake b/cmake/FetchOnnxruntime.cmake index 0b994d8..d6fc288 100644 --- a/cmake/FetchOnnxruntime.cmake +++ b/cmake/FetchOnnxruntime.cmake @@ -73,7 +73,7 @@ if(APPLE) ${CMAKE_INSTALL_NAME_TOOL} -change "@rpath/libonnxruntime.${Onnxruntime_VERSION}.dylib" "@loader_path/../Frameworks/libonnxruntime.${Onnxruntime_VERSION}.dylib" $) elseif(MSVC) - + set(Onnxruntime_LIB_NAMES onnxruntime;onnxruntime_providers_shared) foreach(lib_name IN LISTS Onnxruntime_LIB_NAMES) add_library(Ort::${lib_name} SHARED IMPORTED) @@ -81,7 +81,7 @@ elseif(MSVC) set_target_properties(Ort::${lib_name} PROPERTIES IMPORTED_LOCATION ${onnxruntime_SOURCE_DIR}/lib/${lib_name}.dll) set_target_properties(Ort::${lib_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${onnxruntime_SOURCE_DIR}/include) target_link_libraries(Ort INTERFACE Ort::${lib_name}) - install(FILES ${onnxruntime_SOURCE_DIR}/lib/${lib_name}.dll DESTINATION "obs-plugins/64bit") + install(FILES ${onnxruntime_SOURCE_DIR}/lib/${lib_name}.dll DESTINATION "bin") endforeach() # add exported target install @@ -98,7 +98,7 @@ else() set(Onnxruntime_INSTALL_LIBS ${Onnxruntime_LINK_LIBS} "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime_providers_shared.so") endif() - install(FILES ${Onnxruntime_INSTALL_LIBS} DESTINATION "${CMAKE_INSTALL_LIBDIR}/obs-plugins/${CMAKE_PROJECT_NAME}") + install(FILES ${Onnxruntime_INSTALL_LIBS} DESTINATION "bin") target_link_libraries(Ort INTERFACE ${Onnxruntime_LINK_LIBS}) target_include_directories(Ort INTERFACE "${onnxruntime_SOURCE_DIR}/include")