Skip to content

Conversation

@echoix
Copy link
Member

@echoix echoix commented Jan 4, 2026

What does this PR do?

Skip building test_ogrsf program if BUILD_TESTING is OFF.
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_ogrsf should be non-default, or built only when building testing tools. It seems that in OGR 3.5.0-era, test_ogrsf was built by default but not installed (in autotools builds), see

gdal/NEWS.md

Line 8237 in 9bed24f

* generate test_ogrsf by default (but not installed)

I chose to not build that app if BUILD_TESTING is not ON, 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.c that 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.

	[1030/1446] Building C object ogr/ogrsf_frmts/sqlite/CMakeFiles/my_test_sqlite3_ext.dir/my_test_sqlite3_ext.c.o
	[1031/1446] Linking C shared module gdalplugins/my_test_sqlite3_ext.so

What are related issues/pull requests?

Similar to my older issue #9856, that lead to #9857 and #9864

Tasklist

  • AI (Copilot or something similar) supported my development of this PR
  • Make sure code is correctly formatted (cf pre-commit configuration)
  • Add test case(s)
  • Add documentation
  • Updated Python API documentation (swig/include/python/docs/)
  • Review
  • Adjust for comments
  • All CI builds and checks have passed
  • ADD YOUR TASKS HERE

Environment

Provide environment details, if relevant:

  • OS:
  • Compiler:

@rouault rouault merged commit 661b540 into OSGeo:master Jan 5, 2026
38 checks passed
@echoix echoix deleted the build-testing-test-ogrsf branch January 5, 2026 13:21
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.

2 participants