简体   繁体   English

如何使用 xcconfig 文件将环境配置添加到具有多个项目的工作区

[英]How to add environment configuration to workspace with multiple projects using xcconfig files

I created sample project to demonstrate the problem https://github.com/pikciu/XCodeWorksapce/tree/noPods我创建了示例项目来演示问题https://github.com/pikciu/XCodeWorksapce/tree/noPods

  • invalid paths to frameworks无效的框架路径
  • frameworks build in different configuration than main project.框架构建在与主项目不同的配置中。

There are 4 build configurations and 2 schemes.有 4 种构建配置和 2 种方案。 Every build configuration uses different xcconfig file.每个构建配置使用不同的 xcconfig 文件。 配置 Lib.framework is linked to the main project. Lib.framework 链接到主项目。

XCode builds frameworks in Release configuration even if main project is building in Debug.即使主项目在 Debug 中构建,XCode 也会在 Release 配置中构建框架。 构建失败

I have found these solutions: Xcode Build Configurations in Workspace With Multiple Projects and How to compile a project with app and library in the same workspace with different configuration names?我找到了这些解决方案: Xcode Build Configurations in Workspace With Multiple ProjectsHow to compile a project with app and library in the same workspace with different configuration names?

MODULES_BUILDS = $(DEFAULT_CONFIGURATION)-$(PLATFORM_NAME)
FRAMEWORK_SEARCH_PATHS = $(BUILD_DIR)/$(MODULES_BUILDS)
HEADER_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS)/include
LIBRARY_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS)

but it doesn't work.但它不起作用。 Maybe is it XCode 10 issue?也许是 XCode 10 问题?

Your Lib target is being built with the Release configuration.您的 Lib 目标正在使用 Release 配置构建。 Change this setting Under Configurations of your Lib project, use the Debug configuration for command-line builds.更改此设置 在 Lib 项目的Configurations下,使用命令行构建的Debug配置。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM