-
Notifications
You must be signed in to change notification settings - Fork 7
cmake: modernize CMake infrastructure; adds modules, bindings; build Windows wheels #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5e144e7
.gitignore: ignore CMakeCache.txt and CMakeFiles
gsmecher f9cff67
msvc: don't define FILENAME_MAX if it already exists
gsmecher 3baa45e
Windows: MSVC: Poison GD_TRUNC for now - it is unsafe to unlink while…
gsmecher fe8536d
big_test.py (Python tests): Python 2.x -> 3.x exception update
gsmecher 2355082
big_test.py (Python tests): gracefully handle builds without regex/pc…
gsmecher f99b653
big_test.py (Python tests): CheckEOS: escape input before using re.se…
gsmecher 5092790
big_test.py (Python tests): use path.join for "expected results" with…
gsmecher 7053593
bindings/python: callback.py tests: win32 portability (CRLF and path …
gsmecher c3be171
cmake modernization and python bindings
gsmecher da9913b
CMake: correctly wrangle tests with exit code 77 (autotools conventio…
gsmecher a77fb0a
bindings/python: move pyproject.toml to CMake backend
gsmecher ddbb147
Github workflows: add CMake regression tests and Windows wheels
gsmecher 817c385
test/c89*: place GD_C89_API in an #ifndef guard to squash redefinitio…
gsmecher 1c7ab3c
test/version_5: fix #ifdef within macro expansion
gsmecher 39d279c
Remove HAVE_CONFIG_H macro entirely
gsmecher 049f87b
.github/workflows/package.yml: upgrade cibuildwheel; add Python 3.13/…
gsmecher 030e0d1
bindings/python/pyproject.toml: Teach scikit-build to extract the ver…
gsmecher ca9b776
package.yml: wheel builder: no need to SKIP Python 3.6/3.7 any more
gsmecher d8852ed
CMake/wheels: properly configure and install utils (checkdirfile, dir…
gsmecher 6ead649
MSVC: work around #define snprintf _snprintf in stdio.h
gsmecher 187676f
wheel build: use shared libraries; teach wheel repair steps how to fi…
gsmecher 9b6e3cc
CMake: Add BUILD_CXX compile option; disable it for pyproject.toml en…
gsmecher fbdfa26
CMake: Correct .dll placement for Windows
gsmecher 4dbcfe8
CMake: extract GETDATA_VERSION macros from m4/version.m4
gsmecher a5eef49
bindings/python: fix encoding_support return codes
gsmecher f85bb2a
wheel build: teach arm64 macos to find, build, and install plugins
gsmecher 7e62344
wheel build: restructure .whl files; statically link
gsmecher a1a001e
pyproject.toml: parse version from m4/version.m4
gsmecher ee05e9c
CMake: correctly parse .so versioning information from m4/version.m4
gsmecher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: CMake CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| cmake-build-test: | ||
| name: CMake on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| deps: sudo apt-get update && sudo apt-get install -y cmake bzip2 gzip xz-utils flac zip unzip libbz2-dev liblzma-dev libflac-dev libpcre3-dev libzzip-dev | ||
| - os: macos-latest | ||
| deps: brew install --quiet cmake bzip2 flac xz pcre libzzip | ||
| - os: windows-latest | ||
| deps: choco install cmake --no-progress | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install Python dependencies | ||
| run: python -m pip install numpy>2 | ||
|
|
||
| - name: Install system dependencies | ||
| run: ${{ matrix.deps }} | ||
|
|
||
| - name: Configure CMake | ||
| working-directory: cmake | ||
| run: cmake -B build -DBUILD_PYTHON=ON -DGD_TEST=ON | ||
|
|
||
| - name: Build | ||
| working-directory: cmake | ||
| run: cmake --build build --config Release | ||
|
|
||
| - name: Run tests | ||
| working-directory: cmake | ||
| run: ctest --test-dir build --output-on-failure --build-config Release --no-tests=error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,9 @@ libpath_mangled | |
| Makefile | ||
| Makefile.in | ||
|
|
||
| CMakeFiles | ||
| CMakeCache.txt | ||
|
|
||
| /*.zip | ||
| /*.tar.* | ||
| /*.sig | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,26 @@ | ||
| [build-system] | ||
| requires = ["setuptools", "setuptools-scm", "wheel", "numpy>=2.0"] | ||
| build-backend = "setuptools.build_meta" | ||
| requires = ["scikit-build-core>=0.5", "numpy>=2.0"] | ||
| build-backend = "scikit_build_core.build" | ||
|
|
||
| [project] | ||
| name = "pygetdata" | ||
| dependencies = ["numpy>=1.7"] | ||
| dynamic = ["version"] | ||
|
|
||
| [tool.setuptools] | ||
| script-files = ["../../util/dirfile2ascii", "../../util/checkdirfile"] | ||
arahlin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [tool.scikit-build] | ||
| cmake.source-dir = "../../cmake" | ||
| cmake.build-type = "Release" | ||
| cmake.args = ["-DBUILD_PYTHON=ON", "-DGD_TEST=OFF", "-DGD_UTIL=ON", "-DBUILD_CXX=OFF"] | ||
| install.components = ["Runtime"] | ||
| wheel.install-dir = "." | ||
|
|
||
| [tool.setuptools_scm] | ||
| version_scheme = "only-version" | ||
| local_scheme = "no-local-version" | ||
| [tool.scikit-build.metadata.version] | ||
| provider = "scikit_build_core.metadata.regex" | ||
| input = "../../m4/version.m4" | ||
| regex = ''' | ||
| m4_define\(getdata_major,\s*(?P<major>\d+)\)[\s\S]* | ||
| m4_define\(getdata_minor,\s*(?P<minor>\d+)\)[\s\S]* | ||
| m4_define\(getdata_revision,\s*(?P<micro>\d+)\) | ||
| ''' | ||
| result = "{major}.{minor}.{micro}" | ||
arahlin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.