Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.15)
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)

# Set C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find Python
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)

# Include directories
set(CPYPP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/deps/cpypp/include")
set(FBITSET_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/deps/fbitset/include")
set(LIBPARENTH_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/deps/libparenth/include")

# Platform-specific compiler flags
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
message(STATUS "Configuring for macOS (Darwin)")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
add_compile_options(-stdlib=libc++)
# elseif(MSVC)
# # MSVC compiler flags
# add_compile_options(/EHsc /bigobj /wd4996 /wd4267 /Zc:twoPhase-)
endif()

# parenth extension
Python_add_library(_parenth MODULE
gristmill/_parenth.cpp
WITH_SOABI
)
target_include_directories(_parenth PRIVATE
${CPYPP_INCLUDE_DIR}
${FBITSET_INCLUDE_DIR}
${LIBPARENTH_INCLUDE_DIR}
)
install(TARGETS _parenth LIBRARY DESTINATION gristmill)
17 changes: 9 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["scikit-build-core>=0.10"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
cmake.minimum-version = "3.15" # Minimum version of CMake
cmake.verbose = true # Verbose build for debugging
# Don't create a separate subdirectory - install alongside Python source files
wheel.packages = ["gristmill"]
sdist.include = ["gristmill/templates/*", "deps/cpypp/include/**/*.hpp", "deps/fbitset/include/**/*.hpp", "deps/libparenth/include/**/*.hpp"]

[project]
name = "gristmill"
Expand Down Expand Up @@ -40,9 +47,3 @@ dev = ["pytest", "juliacall>=0.9.20"]

[project.urls]
Homepage = "https://github.com/DrudgeCAS/gristmill"

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
gristmill = ["templates/*"]
41 changes: 0 additions & 41 deletions setup.py

This file was deleted.

Loading