Skip to content

Commit

Permalink
build: 增加 BUILD_PICLI 选项
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Jan 23, 2025
1 parent 4dc1818 commit 1be98b8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 4 additions & 1 deletion source/MaaProjectInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
add_subdirectory(Impl)
add_subdirectory(CLI)

if (BUILD_PICLI)
add_subdirectory(CLI)
endif()
2 changes: 1 addition & 1 deletion source/binding/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 1be98b8

Please sign in to comment.