Skip to content

Commit

Permalink
fix broken build and clean up dist files
Browse files Browse the repository at this point in the history
see issue for what may be a bug in scikit-build-core:
scikit-build/scikit-build-core#914
  • Loading branch information
andrewprock authored and andrewprock-anari committed Sep 27, 2024
1 parent d67da05 commit 10a5af5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*~
build
_build
dist
*.pyc
*.vscode
Expand Down
30 changes: 17 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,17 @@ shell:

## Python wheel package

You will need to install pipx to build with scikit-build-core, using
apt on Ubuntu and brew on MacOS.

There is also a `pyproject.toml` file which can be used to create an
installable wheel for the pythong package. The commands below can be
used to build/install/verify the package.

pipx run build
python3 -m venv venv
. venv/bin/activate
pip install dist/pokerstove-1.2-cp310-cp310-linux_x86_64.whl
pip install dist/pokerstove-*.whl
python src/lib/python/test-python
deactivate

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 10a5af5

Please sign in to comment.