From db937f85e5905481e21ea0762987dce27cfb80d3 Mon Sep 17 00:00:00 2001 From: GavinZhang Date: Wed, 31 Aug 2022 21:23:37 +0800 Subject: [PATCH 1/3] Support OS400 system --- CMakeLists.txt | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7674943..5d1bc85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,15 +88,26 @@ if(UNIX AND NOT APPLE) # Dependencies find_package(PythonInterp REQUIRED) - set(ninja_executable ${Ninja_SOURCE_DIR}/ninja${CMAKE_EXECUTABLE_SUFFIX}) - set(bootstrap_command ${PYTHON_EXECUTABLE} configure.py --bootstrap) - # Explicitly defining _BSD_SOURCE is required to support building the wheel on Alpine. See issue #22 - set(bootstrap_command ${CMAKE_COMMAND} -E env CXXFLAGS=-D_BSD_SOURCE ${bootstrap_command}) - add_custom_command( - COMMAND ${bootstrap_command} - OUTPUT ${ninja_executable} - WORKING_DIRECTORY ${Ninja_SOURCE_DIR} - ) + if(CMAKE_SYSTEM_NAME STREQUAL "OS400") + #configure.py is deprecated by ninja-build project. And it does support OS400. + set(ninja_executable ${Ninja_SOURCE_DIR}/cmake-build/ninja${CMAKE_EXECUTABLE_SUFFIX}) + set(local_cmake_command ${CMAKE_COMMAND} -Bcmake-build -H. && ${CMAKE_COMMAND} --build cmake-build) + add_custom_command( + COMMAND ${local_cmake_command} + OUTPUT ${ninja_executable} + WORKING_DIRECTORY ${Ninja_SOURCE_DIR} + ) + else() + set(ninja_executable ${Ninja_SOURCE_DIR}/ninja${CMAKE_EXECUTABLE_SUFFIX}) + set(bootstrap_command ${PYTHON_EXECUTABLE} configure.py --bootstrap) + # Explicitly defining _BSD_SOURCE is required to support building the wheel on Alpine. See issue #22 + set(bootstrap_command ${CMAKE_COMMAND} -E env CXXFLAGS=-D_BSD_SOURCE ${bootstrap_command}) + add_custom_command( + COMMAND ${bootstrap_command} + OUTPUT ${ninja_executable} + WORKING_DIRECTORY ${Ninja_SOURCE_DIR} + ) + endif() add_custom_target(build_ninja ALL DEPENDS download_ninja_source ${ninja_executable} ) From c42a65d80a608ef69e0b928e124251a2629540c0 Mon Sep 17 00:00:00 2001 From: GavinZhang Date: Thu, 15 Sep 2022 23:36:01 +0800 Subject: [PATCH 2/3] Try to make all platforms using the cmake instead of configure.py --- CMakeLists.txt | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d1bc85..fe45b90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,26 +88,14 @@ if(UNIX AND NOT APPLE) # Dependencies find_package(PythonInterp REQUIRED) - if(CMAKE_SYSTEM_NAME STREQUAL "OS400") - #configure.py is deprecated by ninja-build project. And it does support OS400. - set(ninja_executable ${Ninja_SOURCE_DIR}/cmake-build/ninja${CMAKE_EXECUTABLE_SUFFIX}) - set(local_cmake_command ${CMAKE_COMMAND} -Bcmake-build -H. && ${CMAKE_COMMAND} --build cmake-build) - add_custom_command( - COMMAND ${local_cmake_command} - OUTPUT ${ninja_executable} - WORKING_DIRECTORY ${Ninja_SOURCE_DIR} - ) - else() - set(ninja_executable ${Ninja_SOURCE_DIR}/ninja${CMAKE_EXECUTABLE_SUFFIX}) - set(bootstrap_command ${PYTHON_EXECUTABLE} configure.py --bootstrap) - # Explicitly defining _BSD_SOURCE is required to support building the wheel on Alpine. See issue #22 - set(bootstrap_command ${CMAKE_COMMAND} -E env CXXFLAGS=-D_BSD_SOURCE ${bootstrap_command}) - add_custom_command( - COMMAND ${bootstrap_command} - OUTPUT ${ninja_executable} - WORKING_DIRECTORY ${Ninja_SOURCE_DIR} - ) - endif() + #configure.py is deprecated by ninja-build project. + set(ninja_executable ${Ninja_SOURCE_DIR}/cmake-build/ninja${CMAKE_EXECUTABLE_SUFFIX}) + set(local_cmake_command ${CMAKE_COMMAND} -Bcmake-build -H. && ${CMAKE_COMMAND} --build cmake-build) + add_custom_command( + COMMAND ${local_cmake_command} + OUTPUT ${ninja_executable} + WORKING_DIRECTORY ${Ninja_SOURCE_DIR} + ) add_custom_target(build_ninja ALL DEPENDS download_ninja_source ${ninja_executable} ) From b7bb9e638aa1bd8d81a1c2ddecc5790241859ecb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:40:30 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe45b90..094e023 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ if(UNIX AND NOT APPLE) # Dependencies find_package(PythonInterp REQUIRED) - #configure.py is deprecated by ninja-build project. + #configure.py is deprecated by ninja-build project. set(ninja_executable ${Ninja_SOURCE_DIR}/cmake-build/ninja${CMAKE_EXECUTABLE_SUFFIX}) set(local_cmake_command ${CMAKE_COMMAND} -Bcmake-build -H. && ${CMAKE_COMMAND} --build cmake-build) add_custom_command(