Skip to content

Commit 3ba5f49

Browse files
committed
fix: respect RUN_NINJA_TEST option
1 parent 05f5a5b commit 3ba5f49

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
@@ -100,6 +100,13 @@ musllinux-ppc64le-image = "musllinux_1_1"
100100
musllinux-s390x-image = "musllinux_1_1"
101101
musllinux-armv7l-image = "musllinux_1_2"
102102

103+
[tool.cibuildwheel.config-settings]
104+
"cmake.define.RUN_NINJA_TEST" = "ON"
105+
106+
[[tool.cibuildwheel.overrides]]
107+
select = ["*-win_arm64",]
108+
config-settings."cmake.define.RUN_NINJA_TEST" = "OFF"
109+
103110
[[tool.cibuildwheel.overrides]]
104111
select = "*-macos*"
105112
inherit.environment = "append"

0 commit comments

Comments
 (0)