Skip to content

Plumb through the testing library version into a function instead of a C++ macro. #648

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Aug 28, 2024

This PR moves the consumption of the testing library version (via C++ macro SWT_TESTING_LIBRARY_VERSION) to a C++ function. It seems that defining it in CMake for C++ targets doesn't trigger for the Swift side when it imports symbols from C headers.

Will verify with a toolchain build.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…a macro.

This PR moves the consumption of the testing library version (via C++ macro
`SWT_TESTING_LIBRARY_VERSION`) to a C++ function. It seems that defining it
in CMake for C++ targets doesn't trigger for the Swift side when it imports
symbols from C headers.

Will verify with a toolchain build.
@grynspan grynspan added bug 🪲 Something isn't working build 🧱 Affects the project's build configuration or process swift-6.1 labels Aug 28, 2024
@grynspan grynspan self-assigned this Aug 28, 2024
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Aug 28, 2024

Verified this works in a toolchain build:

◇ Test run started.
↳ Testing Library Version: 6.1-dev (26451155133ecb2)
✔ Test run with 0 tests passed after 0.001 seconds.

@grynspan
Copy link
Contributor Author

Self-reviewing. @briancroom is aware of the change.

@grynspan grynspan added the self-reviewed PR was self-reviewed by a code owner label Aug 28, 2024
@grynspan grynspan merged commit ab1b0f9 into main Aug 28, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/get-version-from-cmake-a-different-way branch August 28, 2024 21:59
grynspan added a commit that referenced this pull request Aug 28, 2024
…ad of a C++ macro. (#649)

**Explanation:** Correctly sets the testing library version (it was
failing to set on the Swift side.)
**Scope:** Building with CMake
**Issue:** N/A
**Original PR:** #648
**Risk:** Low
**Testing:** Built a toolchain and verified the string was ingested all
the way through.
**Reviewer:** @grynspan @briancroom
grynspan added a commit that referenced this pull request Aug 29, 2024
…tead of a C++ macro. (#650)

**Explanation:** Correctly sets the testing library version (it was
failing to set on the Swift side.)
**Scope:** Building with CMake
**Issue:** N/A
**Original PR:** #648
**Risk:** Low
**Testing:** Built a toolchain and verified the string was ingested all
the way through.
**Reviewer:** @grynspan @briancroom
@grynspan grynspan added this to the Swift 6.1 milestone Sep 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug 🪲 Something isn't working build 🧱 Affects the project's build configuration or process self-reviewed PR was self-reviewed by a code owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant