From 0292c7e0d949531b280e73726aa21c529d176a48 Mon Sep 17 00:00:00 2001 From: mayeut Date: Mon, 2 Dec 2024 00:05:54 +0100 Subject: [PATCH] fix: respect RUN_NINJA_TEST option --- CMakeLists.txt | 12 +++++++++--- pyproject.toml | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5141271..94757f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "************************************") @@ -22,5 +20,13 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(ninja) +if(RUN_NINJA_TEST) + add_custom_target( + run_ninja_test ALL "$" + DEPENDS ninja_test + WORKING_DIRECTORY "$" + ) +endif() + install(TARGETS ninja COMPONENT python DESTINATION "${SKBUILD_SCRIPTS_DIR}") install(FILES "${ninja_SOURCE_DIR}/misc/ninja_syntax.py" COMPONENT python DESTINATION ninja) diff --git a/pyproject.toml b/pyproject.toml index 8880d90..51d3058 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"