Skip to content

[codex] Make developer targets opt-in for consumers#3

Merged
aviaviavi merged 1 commit into
mainfrom
codex/fetchcontent-defaults
May 29, 2026
Merged

[codex] Make developer targets opt-in for consumers#3
aviaviavi merged 1 commit into
mainfrom
codex/fetchcontent-defaults

Conversation

@aviaviavi

Copy link
Copy Markdown
Contributor

Summary

  • Default SCARF_CPP_BUILD_TESTS and SCARF_CPP_BUILD_EXAMPLES to ON only when scarf-cpp is the top-level CMake project.
  • Default those developer targets to OFF when the SDK is consumed as a subproject, such as through FetchContent or add_subdirectory.

Why

Consumers should be able to pull the SDK from source without unexpectedly adding the SDK's tests and examples to their own build graph. Local development of this repo still keeps the existing convenient default behavior.

Validation

  • cmake -S . -B /tmp/scarf-cpp-top-build && cmake --build /tmp/scarf-cpp-top-build && ctest --test-dir /tmp/scarf-cpp-top-build --output-on-failure
  • Temporary consumer project using add_subdirectory(/Users/avi/dev/cpp-sdk scarf-cpp-build) configured, built, and ran successfully while confirming the SDK test/example targets were not created.
  • git diff --check

@aviaviavi aviaviavi marked this pull request as ready for review May 29, 2026 16:11
@aviaviavi aviaviavi merged commit d9b0a78 into main May 29, 2026
2 checks passed
@aviaviavi aviaviavi deleted the codex/fetchcontent-defaults branch May 29, 2026 16:12
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.

1 participant