diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 7888e41df..1dfc724b9 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -242,15 +242,15 @@ jobs: run: cargo build -p voicevox_core_java_api -vv --target ${{ matrix.target }} --release - name: Organize artifact run: | - mkdir -p "artifact/${{ env.ASSET_NAME }}" + mkdir -p artifact/${{ env.ASSET_NAME }}/{include,lib} case ${{ matrix.c_release_format }} in plain-cdylib) feature=VOICEVOX_LOAD_ONNXRUNTIME ;; ios-xcframework) feature=VOICEVOX_LINK_ONNXRUNTIME ;; esac sed 's:^//\(#define '"$feature"'\)$:\1:' crates/voicevox_core_c_api/include/voicevox_core.h \ - > "artifact/${{ env.ASSET_NAME }}/voicevox_core.h" - cp -v target/${{ matrix.target }}/release/*voicevox_core.{dll,so,dylib} "artifact/${{ env.ASSET_NAME }}" || true - cp -v target/${{ matrix.target }}/release/voicevox_core.dll.lib "artifact/${{ env.ASSET_NAME }}/voicevox_core.lib" || true + > "artifact/${{ env.ASSET_NAME }}/include/voicevox_core.h" + cp -v target/${{ matrix.target }}/release/*voicevox_core.{dll,so,dylib} "artifact/${{ env.ASSET_NAME }}/lib" || true + cp -v target/${{ matrix.target }}/release/voicevox_core.dll.lib "artifact/${{ env.ASSET_NAME }}/lib/voicevox_core.lib" || true cp -v README.md "artifact/${{ env.ASSET_NAME }}/README.txt" cp -v LICENSE "artifact/${{ env.ASSET_NAME }}/" echo "${{ env.VERSION }}" > "artifact/${{ env.ASSET_NAME }}/VERSION" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 917aaf3e2..83c43f522 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -201,11 +201,12 @@ jobs: run: cargo build -p voicevox_core_c_api --features load-onnxruntime -v - name: 必要なfileをunix用exampleのディレクトリに移動させる run: | - mkdir -p example/cpp/unix/voicevox_core/c_api + mkdir -p example/cpp/unix/voicevox_core/c_api/{include,lib} sed 's:^//\(#define VOICEVOX_LOAD_ONNXRUNTIME\)$:\1:' \ crates/voicevox_core_c_api/include/voicevox_core.h \ - > example/cpp/unix/voicevox_core/c_api/voicevox_core.h - cp -v target/debug/libvoicevox_core.{so,dylib} example/cpp/unix/voicevox_core/c_api/ || true + > example/cpp/unix/voicevox_core/c_api/include/voicevox_core.h + cp -v target/debug/libvoicevox_core.{so,dylib} example/cpp/unix/voicevox_core/c_api/lib/ || true + # FIXME: ↓この二つ要らないのでは? cp -v target/debug/libonnxruntime.so.* example/cpp/unix/voicevox_core/ || true cp -v target/debug/libonnxruntime.*.dylib example/cpp/unix/voicevox_core/ || true diff --git a/example/cpp/unix/CMakeLists.txt b/example/cpp/unix/CMakeLists.txt index 845e2fe0f..a2ed85322 100644 --- a/example/cpp/unix/CMakeLists.txt +++ b/example/cpp/unix/CMakeLists.txt @@ -6,8 +6,8 @@ add_executable(simple_tts simple_tts.cpp) set_property(TARGET simple_tts PROPERTY CXX_STANDARD 17) file(GLOB ONNXRUNTIME_SHARED_LIB ./libonnxruntime.so.* ./libonnxruntime.*.dylib) # TODO: なにこれ -target_link_directories(simple_tts PRIVATE ./voicevox_core/c_api/) +target_link_directories(simple_tts PRIVATE ./voicevox_core/c_api/lib/) -file(GLOB CORE_LIB ./voicevox_core/c_api/libvoicevox_core.so.* ./voicevox_core/c_api/libvoicevox_core.*.dylib) # TODO: なにこれ +file(GLOB CORE_LIB ./voicevox_core/c_api/lib/libvoicevox_core.so.* ./voicevox_core/c_api/lib/libvoicevox_core.*.dylib) # TODO: なにこれ target_link_libraries(simple_tts voicevox_core) diff --git a/example/cpp/unix/simple_tts.cpp b/example/cpp/unix/simple_tts.cpp index 30eac7cad..99140c0cd 100644 --- a/example/cpp/unix/simple_tts.cpp +++ b/example/cpp/unix/simple_tts.cpp @@ -3,7 +3,7 @@ #include #include -#include "voicevox_core/c_api/voicevox_core.h" +#include "voicevox_core/c_api/include/voicevox_core.h" #define STYLE_ID 0 #define OUTPUT_WAV_NAME "audio.wav"