Skip to content

Commit

Permalink
Use modern Podfile syntax to avoid polluting application build settin…
Browse files Browse the repository at this point in the history
…gs (#35954)

Summary:
Fixes conflicts in pod build settings like the one below:

Example warning
> Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

Background:

> The former attribute xcconfig is deprecated and will cause a linter error when pushing new versions to trunk. The new attributes are available as pod_target_xcconfig and user_target_xcconfig, which makes their effects more clear. The latter attribute (user_target_xcconfig) should be used with great care, because well designed Pods should be self-contained and make as few assumptions about their environment as possible. Furthermore, this attribute can cause conflicts when different values are specified by two Pods for a build setting which doesn't allow multiple values and so cannot be merged.
- https://blog.cocoapods.org/CocoaPods-0.38/

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - Fix cocoapods warning about merging user_target_xcconfig

-->

Pull Request resolved: #35954

Test Plan:
- Run in example app

## Related PR

- facebook/hermes#903

Reviewed By: christophpurrer

Differential Revision: D42737921

Pulled By: jacdebug

fbshipit-source-id: 75d087a5287e660a703342d6e0ad6632f05f3c4c
  • Loading branch information
yhkaplan authored and facebook-github-bot committed Jan 25, 2023
1 parent 305ca33 commit 2bfb53c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdks/hermes-engine/hermes-engine.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Pod::Spec.new do |spec|
spec.preserve_paths = '**/*.*'
spec.source_files = ''

spec.xcconfig = {
spec.pod_target_xcconfig = {
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"CLANG_CXX_LIBRARY" => "compiler-default"
}.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {})
Expand Down

0 comments on commit 2bfb53c

Please sign in to comment.