From f31774b623831dbb6a4a947da23b8f089c037010 Mon Sep 17 00:00:00 2001 From: Andrew Prock Date: Thu, 26 Sep 2024 18:30:20 -0700 Subject: [PATCH] fix broken build and clean up dist files see issue for what may be a bug in scikit-build-core: https://github.com/scikit-build/scikit-build-core/issues/914 --- .gitignore | 1 - CMakeLists.txt | 30 +++++++++++++++++------------- pyproject.toml | 1 + 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 47d9567..ce4262e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *~ build -_build dist *.pyc *.vscode diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c056b..58656fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register") # Set up gtest. This must be set up before any subdirectories are # added which will use gtest. # TODO: clean this up a bit, maybe make this optional? -add_subdirectory(src/ext/googletest) include_directories(${GTEST_INCLUDE_DIRS}) link_directories(${GTEST_LIBS_DIR}) add_definitions("-fPIC") @@ -36,19 +35,24 @@ include_directories("${PROJECT_BINARY_DIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -# This controls whether or not to build the python bridge -if(BUILD_PYTHON) - add_subdirectory(src/lib/python) -endif() # add the actual code include_directories(src/lib) add_subdirectory(src/lib) -add_subdirectory(src/programs) - -# Add make install functionality -#install(TARGETS peval) -#install(TARGETS penum) -#install(TARGETS ps-colex) -#install(TARGETS ps-eval) -#install(TARGETS ps-lut) + +# This controls whether or not we are building the python +# binaries, and possibly the wheel file. +# TODO: add a separate option for building the wheel vs. python +if(BUILD_PYTHON) + add_subdirectory(src/lib/python) +else() + # none of these are needed in the wheel file + add_subdirectory(src/programs) + add_subdirectory(src/ext/googletest) + # Add make install functionality + install(TARGETS peval) + install(TARGETS penum) + install(TARGETS ps-colex) + install(TARGETS ps-eval) + install(TARGETS ps-lut) +endif() diff --git a/pyproject.toml b/pyproject.toml index 5d87beb..a7c63bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ cmake.version = ">=3.5" cmake.build-type = "Release" build.targets = ["pokerstove"] install.components = ["pokerstove"] +sdist.exclude = ["src/programs", "android", "win32", "src/ext", "doc", ".*"] # build.verbose = true # logging.level = "DEBUG"