test_ogrsf: do not build test program if BUILD_TESTING=OFF #13636
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.
What does this PR do?
Skip building test_ogrsf program if
BUILD_TESTINGisOFF.I noticed in GRASS' Docker builds where gdal is built from source, that some test targets are still being built. This non-default app is being built by default (notice the contradiction here). Either the
test_ogrsfshould be non-default, or built only when building testing tools. It seems that in OGR 3.5.0-era,test_ogrsfwas built by default but not installed (in autotools builds), seegdal/NEWS.md
Line 8237 in 9bed24f
I chose to not build that app if
BUILD_TESTINGis notON, similar to how some sample programs were not built in the issues/PRs listed below.With feedback, I could also add more apps to not build when tests are not built, but they don't seem to be built unconditionally.
There is also
my_test_sqlite3_ext.cthat seems to be always built. Maybe a solution like the issues/PRs below should apply, but I was unsure of the implications, so I left it as is for now.What are related issues/pull requests?
Similar to my older issue #9856, that lead to #9857 and #9864
Tasklist
Environment
Provide environment details, if relevant: