From 1be98b84adc4dcd03ada9855360d2ec3c9642b90 Mon Sep 17 00:00:00 2001 From: MistEO Date: Thu, 23 Jan 2025 16:38:01 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E5=A2=9E=E5=8A=A0=20BUILD=5FPICLI=20?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 6 +++--- .github/workflows/test.yml | 14 +++++++++----- CMakeLists.txt | 7 ++++--- source/MaaProjectInterface/CMakeLists.txt | 5 ++++- source/binding/CMakeLists.txt | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df97a2c0f..3aab1036f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,7 +98,7 @@ jobs: - name: Build MAA run: | - cmake --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }}" -DCMAKE_SYSTEM_VERSION="10.0.26100.0" -DMAADEPS_TRIPLET="maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-windows" -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' -DBUILD_NODEJS_BINDING=ON + cmake --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }}" -DCMAKE_SYSTEM_VERSION="10.0.26100.0" -DMAADEPS_TRIPLET="maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-windows" -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' -DWITH_NODEJS_BINDING=ON cmake --build build --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }} - ${{ inputs.build_config || needs.meta.outputs.build_config }}" -j 16 @@ -187,7 +187,7 @@ jobs: cmake --preset 'NinjaMulti' \ -DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux' \ -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' \ - -DBUILD_NODEJS_BINDING=ON + -DWITH_NODEJS_BINDING=ON cmake --build build --preset 'NinjaMulti - ${{ inputs.build_config || needs.meta.outputs.build_config }}' -j 16 @@ -269,7 +269,7 @@ jobs: -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' \ -DCMAKE_C_COMPILER=${LLVM_PREFIX}/bin/clang \ -DCMAKE_CXX_COMPILER=${LLVM_PREFIX}/bin/clang++ \ - -DBUILD_NODEJS_BINDING=ON + -DWITH_NODEJS_BINDING=ON cmake --build build --preset 'NinjaMulti - ${{ inputs.build_config || needs.meta.outputs.build_config }}' -j 16 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59b5dca1d..4f3b1aa21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,7 +97,7 @@ jobs: - name: Build MAA run: | - cmake --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }}" -DMAADEPS_TRIPLET="maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-windows" -DCMAKE_SYSTEM_VERSION="10.0.26100.0" -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' -DBUILD_NODEJS_BINDING=ON -DBUILD_PIPELINE_TESTING=ON -DBUILD_DLOPEN_TESTING=ON + cmake --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }}" -DMAADEPS_TRIPLET="maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-windows" -DCMAKE_SYSTEM_VERSION="10.0.26100.0" -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' -DWITH_NODEJS_BINDING=ON -DBUILD_PICLI=OFF -DBUILD_PIPELINE_TESTING=ON -DBUILD_DLOPEN_TESTING=ON cmake --build build --preset "${{ matrix.arch == 'x86_64' && 'MSVC 2022' || 'MSVC 2022 ARM' }} - Debug" -j 16 @@ -218,8 +218,10 @@ jobs: cmake --preset 'NinjaMulti' \ -DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux' \ -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' \ - -DBUILD_NODEJS_BINDING=ON \ - -DBUILD_PIPELINE_TESTING=ON -DBUILD_DLOPEN_TESTING=ON + -DWITH_NODEJS_BINDING=ON \ + -DBUILD_PICLI=OFF \ + -DBUILD_PIPELINE_TESTING=ON \ + -DBUILD_DLOPEN_TESTING=ON cmake --build build --preset 'NinjaMulti - Debug' -j 16 @@ -336,8 +338,10 @@ jobs: -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' \ -DCMAKE_C_COMPILER=${LLVM_PREFIX}/bin/clang \ -DCMAKE_CXX_COMPILER=${LLVM_PREFIX}/bin/clang++ \ - -DBUILD_NODEJS_BINDING=ON \ - -DBUILD_PIPELINE_TESTING=ON -DBUILD_DLOPEN_TESTING=ON + -DWITH_NODEJS_BINDING=ON \ + -DBUILD_PICLI=OFF \ + -DBUILD_PIPELINE_TESTING=ON \ + -DBUILD_DLOPEN_TESTING=ON cmake --build build --preset 'NinjaMulti - Debug' -j 16 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0deffd8f0..79897ab8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,14 +13,15 @@ option(USE_MAADEPS "use third-party libraries built by MaaDeps" ON) option(WITH_ADB_CONTROLLER "build with adb controller" ON) option(WITH_WIN32_CONTROLLER "build with win32 controller" ON) option(WITH_DBG_CONTROLLER "build with debugging controller" ON) -option(ENABLE_CCACHE "enable ccache if possible" ON) -option(BUILD_NODEJS_BINDING "build nodejs binding" OFF) +option(WITH_NODEJS_BINDING "build with nodejs binding" OFF) +option(BUILD_PICLI "build maa picli" ON) option(BUILD_SAMPLE "build a demo" OFF) - option(BUILD_PIPELINE_TESTING "build pipeline testing" OFF) option(BUILD_DLOPEN_TESTING "build dlopen testing" OFF) +option(ENABLE_CCACHE "enable ccache if possible" ON) + set(MAA_PUBLIC_INC ${CMAKE_SOURCE_DIR}/include) set(MAA_PRIVATE_INC ${CMAKE_SOURCE_DIR}/source/include) diff --git a/source/MaaProjectInterface/CMakeLists.txt b/source/MaaProjectInterface/CMakeLists.txt index 4aafeb8e7..3e353f7d3 100644 --- a/source/MaaProjectInterface/CMakeLists.txt +++ b/source/MaaProjectInterface/CMakeLists.txt @@ -1,2 +1,5 @@ add_subdirectory(Impl) -add_subdirectory(CLI) \ No newline at end of file + +if (BUILD_PICLI) + add_subdirectory(CLI) +endif() \ No newline at end of file diff --git a/source/binding/CMakeLists.txt b/source/binding/CMakeLists.txt index 0eade5a6f..9cafdc52b 100644 --- a/source/binding/CMakeLists.txt +++ b/source/binding/CMakeLists.txt @@ -1,4 +1,4 @@ -if(BUILD_NODEJS_BINDING) +if(WITH_NODEJS_BINDING) if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/NodeJS/node_modules) add_subdirectory(NodeJS) else()