Skip to content
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

Add CTest support and option to skip test progs #760

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cho-m
Copy link
Contributor

@cho-m cho-m commented Oct 25, 2024

Partially fix #759 when building for distribution that doesn't care about test programs. Similar idea to how CTest -DBUILD_TESTING=OFF or GNOME's common meson -Dtests=disabled usually avoids compiling unnecessary files.

Build can still fail on Linux/glibc when -DBUILD_TESTING=ON as some progs needs -lm but lower priority for packaging which is my main concern.

Used BUILD_TESTING option as that is default for CTest1 so can be compatible if future switch to include(CTest).

Note that CI does not test this as BUILD_PROG=OFF for Linux:

run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja -DSW_BUILD=OFF -DBUILD_PROG=OFF -DBUILD_SHARED_LIBS=ON

Footnotes

  1. https://cmake.org/cmake/help/latest/module/CTest.html

@cho-m cho-m marked this pull request as draft November 2, 2024 18:25
@cho-m cho-m force-pushed the cmake-allow-skipping-test-progs branch from 6738e2c to db39664 Compare November 2, 2024 18:29
@cho-m cho-m changed the title Allow CMake build to skip test progs Add CTest support and option for minimum progs Nov 2, 2024
@cho-m
Copy link
Contributor Author

cho-m commented Nov 2, 2024

Not entirely sure on test cases. Seems to run.

However, I think the full test suite will fail without gnuplot.

@zdenop
Copy link
Collaborator

zdenop commented Nov 2, 2024

The primary building tools are autotools. I am not sure if it make sense to run the same with another build system (cmake). This is the reason why did not build progs with cmake (not to waste resources and time).

@cho-m cho-m force-pushed the cmake-allow-skipping-test-progs branch from db39664 to 15a997a Compare November 2, 2024 19:56
@cho-m cho-m changed the title Add CTest support and option for minimum progs Add CTest support and option to skip test progs Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake build with BUILD_PROG=ON fails on Linux due to libm
2 participants