From c0bc265b675ab20b9fec7e00a2051675b21306d3 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Wed, 14 Nov 2018 11:42:32 -0500 Subject: [PATCH] Fix up the Xcode project. The builds were failing under Xcode 10 because of the new build system. Even when reverted to the old build system, the build was failing on the analyzer and swift bridging header, so it seems the general logic for searching for things was changed in a way the setting does not always cover. - Disable HeaderMaps. - Set user header search paths instead of system search paths. - Turn off always search user paths (now recommended). Tested in Xcode 10.1 and 9.4.1; both are able to build/pass with this. --- .../project.pbxproj | 22 +++++++------------ .../project.pbxproj | 20 +++++------------ 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj index 556bb2c46..4c3776a26 100644 --- a/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj @@ -149,7 +149,6 @@ 8B09AAF614B663A7007B4184 /* unittest_objc.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_objc.proto; sourceTree = ""; }; 8B210CCD159383D60032D72D /* golden_message */ = {isa = PBXFileReference; lastKnownFileType = file; path = golden_message; sourceTree = ""; }; 8B210CCF159386920032D72D /* golden_packed_fields_message */ = {isa = PBXFileReference; lastKnownFileType = file; path = golden_packed_fields_message; sourceTree = ""; }; - 8B4248B81A8C254000BC1EC6 /* protobuf */ = {isa = PBXFileReference; lastKnownFileType = text; name = protobuf; path = ../../Intermediates/ProtocolBuffers_OSX.build/DerivedSources/protos/google/protobuf; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4248B91A8C256900BC1EC6 /* UnitTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UnitTests-Bridging-Header.h"; sourceTree = ""; }; 8B4248BA1A8C256A00BC1EC6 /* GPBSwiftTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GPBSwiftTests.swift; sourceTree = ""; }; 8B4248CF1A927E1500BC1EC6 /* GPBWellKnownTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBWellKnownTypes.h; sourceTree = ""; }; @@ -438,7 +437,6 @@ 7461B6940F94FDDD00A0C422 /* Tests */ = { isa = PBXGroup; children = ( - 8B4248B81A8C254000BC1EC6 /* protobuf */, 8B210CCD159383D60032D72D /* golden_message */, 8B210CCF159386920032D72D /* golden_packed_fields_message */, 8B8B615C17DF7056002EE618 /* GPBARCUnittestProtos.m */, @@ -820,8 +818,8 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Debug; }; @@ -830,8 +828,8 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Release; }; @@ -841,10 +839,6 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = ( - "${PROJECT_DERIVED_FILE_DIR}/protos", - "$(SRCROOT)", - ); INFOPLIST_FILE = "Tests/UnitTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; OTHER_LDFLAGS = "-ObjC"; @@ -853,6 +847,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "Tests/UnitTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.0; + USER_HEADER_SEARCH_PATHS = "${PROJECT_DERIVED_FILE_DIR}/protos $(SRCROOT)"; WARNING_CFLAGS = ( "$(inherited)", "-Wno-documentation-unknown-command", @@ -868,10 +863,6 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = ( - "${PROJECT_DERIVED_FILE_DIR}/protos", - "$(SRCROOT)", - ); INFOPLIST_FILE = "Tests/UnitTests-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; OTHER_LDFLAGS = "-ObjC"; @@ -879,6 +870,7 @@ PRODUCT_NAME = UnitTests; SWIFT_OBJC_BRIDGING_HEADER = "Tests/UnitTests-Bridging-Header.h"; SWIFT_VERSION = 4.0; + USER_HEADER_SEARCH_PATHS = "${PROJECT_DERIVED_FILE_DIR}/protos $(SRCROOT)"; WARNING_CFLAGS = ( "$(inherited)", "-Wno-documentation-unknown-command", @@ -947,6 +939,7 @@ ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = macosx; + USE_HEADERMAP = NO; WARNING_CFLAGS = ( "-Wdocumentation-unknown-command", "-Wundef", @@ -1015,6 +1008,7 @@ RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + USE_HEADERMAP = NO; WARNING_CFLAGS = ( "-Wdocumentation-unknown-command", "-Wundef", @@ -1031,8 +1025,8 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Debug; }; @@ -1041,8 +1035,8 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Release; }; diff --git a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj index 940802a8d..ae794a8e3 100644 --- a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj @@ -152,7 +152,6 @@ 8B210CCF159386920032D72D /* golden_packed_fields_message */ = {isa = PBXFileReference; lastKnownFileType = file; path = golden_packed_fields_message; sourceTree = ""; }; 8B4248B21A8BD96D00BC1EC6 /* UnitTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UnitTests-Bridging-Header.h"; sourceTree = ""; }; 8B4248B31A8BD96E00BC1EC6 /* GPBSwiftTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GPBSwiftTests.swift; sourceTree = ""; }; - 8B4248B71A8BDD9600BC1EC6 /* protobuf */ = {isa = PBXFileReference; lastKnownFileType = text; name = protobuf; path = ../../Intermediates/ProtocolBuffers_iOS.build/DerivedSources/protos/google/protobuf; sourceTree = BUILT_PRODUCTS_DIR; }; 8B4248DD1A929C7D00BC1EC6 /* Duration.pbobjc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Duration.pbobjc.h; path = google/protobuf/Duration.pbobjc.h; sourceTree = ""; }; 8B4248DE1A929C7D00BC1EC6 /* Duration.pbobjc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = Duration.pbobjc.m; path = google/protobuf/Duration.pbobjc.m; sourceTree = ""; }; 8B4248E01A929C7D00BC1EC6 /* Timestamp.pbobjc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = Timestamp.pbobjc.m; path = google/protobuf/Timestamp.pbobjc.m; sourceTree = ""; }; @@ -444,7 +443,6 @@ 7461B6940F94FDDD00A0C422 /* Tests */ = { isa = PBXGroup; children = ( - 8B4248B71A8BDD9600BC1EC6 /* protobuf */, 8B210CCD159383D60032D72D /* golden_message */, 8B210CCF159386920032D72D /* golden_packed_fields_message */, 8B8B615C17DF7056002EE618 /* GPBARCUnittestProtos.m */, @@ -826,9 +824,9 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Debug; }; @@ -836,9 +834,9 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Release; }; @@ -851,10 +849,6 @@ "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); - HEADER_SEARCH_PATHS = ( - "${PROJECT_DERIVED_FILE_DIR}/protos", - "$(SRCROOT)", - ); INFOPLIST_FILE = "Tests/UnitTests-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -868,6 +862,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "${PROJECT_DERIVED_FILE_DIR}/protos $(SRCROOT)"; WARNING_CFLAGS = ( "$(inherited)", "-Wno-documentation-unknown-command", @@ -886,10 +881,6 @@ "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); - HEADER_SEARCH_PATHS = ( - "${PROJECT_DERIVED_FILE_DIR}/protos", - "$(SRCROOT)", - ); INFOPLIST_FILE = "Tests/UnitTests-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -902,6 +893,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "Tests/UnitTests-Bridging-Header.h"; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "${PROJECT_DERIVED_FILE_DIR}/protos $(SRCROOT)"; WARNING_CFLAGS = ( "$(inherited)", "-Wno-documentation-unknown-command", @@ -1055,9 +1047,9 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Debug; }; @@ -1065,9 +1057,9 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)"; }; name = Release; };