Skip to content

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
develfrom
docs/xcode-apple-silicon-discovery-mode
Open

Document that DISCOVERY_MODE PRE_TEST should be used with catch_discover_tests when used with XCode.#3172
philsquared wants to merge 1 commit into
develfrom
docs/xcode-apple-silicon-discovery-mode

Conversation

@philsquared

Copy link
Copy Markdown
Collaborator

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 the PRE_TEST discover mode, that runs after the code has been signed.

Changing the default discovery mode for Xcode to POST_BUILD was 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

…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 rajpratham1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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