Document that DISCOVERY_MODE PRE_TEST should be used with catch_discover_tests when used with XCode.#3172
Open
philsquared wants to merge 1 commit into
Open
Document that DISCOVERY_MODE PRE_TEST should be used with catch_discover_tests when used with XCode.#3172philsquared wants to merge 1 commit into
philsquared wants to merge 1 commit into
Conversation
…ver_tests when used with XCode. This addresses #2411 by making the "workaround" the official approach and is consistent with how gtest and cmake deal with the same situation.
rajpratham1
approved these changes
Jul 11, 2026
rajpratham1
left a comment
There was a problem hiding this comment.
Nice documentation improvement. This captures a platform-specific issue that can be difficult to diagnose and clearly explains both the cause (Xcode code-signing order) and the workaround (DISCOVERY_MODE PRE_TEST). Adding the note to both the user documentation and the CMake helper comments is a good touch. No concerns from my side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This addresses #2411 by making the "workaround" the official approach and is consistent with how gtest and cmake deal with the same situation.
When using the Xcode generator on Apple Silicon using the default discover mode,
POST_BUILD, macOS will refuse to run due to being unsigned. The build is signed later in the process - after the post build script. So the remedy is to use thePRE_TESTdiscover mode, that runs after the code has been signed.Changing the default discovery mode for Xcode to
POST_BUILDwas considered, but this would have been a change in behaviour for Intel Mac users (if there are any left), so being explicit seemed to be the better option.We could also have pre-signed (which would have been later overwritten) but this seemed more heavyweight, disruptive and potentially error prone.
GitHub Issues
Addresses #2411