Skip to content

Commit

Permalink
fix: respect RUN_NINJA_TEST option
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Dec 3, 2024
1 parent 9fe6e50 commit 0b276d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ project(NinjaPythonDistributions)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH})

# Options
option(BUILD_VERBOSE "Display additional information while building (e.g download progress, ...)" OFF)
option(RUN_NINJA_TEST "Run Ninja test suite" ON)
option(RUN_NINJA_TEST "Run Ninja test suite" OFF)

message(STATUS "************************************")
message(STATUS "Ninja Python Distribution")
message(STATUS "")
message(STATUS " BUILD_VERBOSE : ${BUILD_VERBOSE}")
message(STATUS " RUN_NINJA_TEST : ${RUN_NINJA_TEST}")
message(STATUS "************************************")

Expand All @@ -22,5 +20,13 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(ninja)

if(RUN_NINJA_TEST)
add_custom_target(
run_ninja_test ALL "$<TARGET_FILE:ninja_test>"
DEPENDS ninja_test
WORKING_DIRECTORY "$<TARGET_FILE_DIR:ninja_test>"
)
endif()

install(TARGETS ninja COMPONENT python DESTINATION "${SKBUILD_SCRIPTS_DIR}")
install(FILES "${ninja_SOURCE_DIR}/misc/ninja_syntax.py" COMPONENT python DESTINATION ninja)
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ musllinux-ppc64le-image = "musllinux_1_1"
musllinux-s390x-image = "musllinux_1_1"
musllinux-armv7l-image = "musllinux_1_2"

[tool.cibuildwheel.config-settings]
"cmake.define.RUN_NINJA_TEST" = "ON"

[[tool.cibuildwheel.overrides]]
select = ["*-win_arm64",]
config-settings."cmake.define.RUN_NINJA_TEST" = "OFF"

[[tool.cibuildwheel.overrides]]
select = "*-macos*"
inherit.environment = "append"
Expand Down

0 comments on commit 0b276d4

Please sign in to comment.