我创建了示例项目来演示问题 https://github.com/pikciu/XCodeWorksapce/tree/noPods
有4种构建配置和2种方案。每个构建配置都使用不同的xcconfig文件。 Lib.framework链接到主项目。
即使主项目是在Debug中构建的,XCode也会在Release配置中构建框架。
我找到了以下解决方案: Xcode Build Configurations in Workspace With Multiple Projects和How 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)
但是它不起作用。也许是XCode 10问题?