Skip to content

Commit 4d0cbaa

Browse files
committed
fix: respect RUN_NINJA_TEST option
1 parent 7310e87 commit 4d0cbaa

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

CMakeLists.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ project(NinjaPythonDistributions)
55
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH})
66

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

1110
message(STATUS "************************************")
1211
message(STATUS "Ninja Python Distribution")
1312
message(STATUS "")
14-
message(STATUS " BUILD_VERBOSE : ${BUILD_VERBOSE}")
1513
message(STATUS " RUN_NINJA_TEST : ${RUN_NINJA_TEST}")
1614
message(STATUS "************************************")
1715

@@ -22,5 +20,13 @@ FetchContent_Declare(
2220
)
2321
FetchContent_MakeAvailable(ninja)
2422

23+
if(RUN_NINJA_TEST)
24+
add_custom_target(
25+
run_ninja_test ALL "$<TARGET_FILE:ninja_test>"
26+
DEPENDS ninja_test
27+
WORKING_DIRECTORY "$<TARGET_FILE_DIR:ninja_test>"
28+
)
29+
endif()
30+
2531
install(TARGETS ninja COMPONENT python DESTINATION "${SKBUILD_SCRIPTS_DIR}")
2632
install(FILES "${ninja_SOURCE_DIR}/misc/ninja_syntax.py" COMPONENT python DESTINATION ninja)

pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ musllinux-ppc64le-image = "musllinux_1_1"
9898
musllinux-s390x-image = "musllinux_1_1"
9999
musllinux-armv7l-image = "musllinux_1_2"
100100

101+
[tool.cibuildwheel.config-settings]
102+
"cmake.define.RUN_NINJA_TEST" = "ON"
103+
104+
[[tool.cibuildwheel.overrides]]
105+
select = ["*-win_arm64",]
106+
config-settings."cmake.define.RUN_NINJA_TEST" = "OFF"
107+
101108
[[tool.cibuildwheel.overrides]]
102109
select = "*-macos*"
103110
inherit.environment = "append"

0 commit comments

Comments
 (0)