From a2e059aca86068470c503edc1ca1288c9369c27f Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Fri, 17 Nov 2023 16:23:14 +0100 Subject: [PATCH] [#84] iOS: Fixes builds for custom-named build configurations --- dr-pogodin-react-native-static-server.podspec | 11 +- example/ios/Podfile.lock | 2 +- .../project.pbxproj | 157 ++++++++++++++++++ .../ReactNativeStaticServerExample.xcscheme | 2 +- 4 files changed, 168 insertions(+), 4 deletions(-) diff --git a/dr-pogodin-react-native-static-server.podspec b/dr-pogodin-react-native-static-server.podspec index 0dfff7e5..a7cdd095 100644 --- a/dr-pogodin-react-native-static-server.podspec +++ b/dr-pogodin-react-native-static-server.podspec @@ -60,10 +60,17 @@ Pod::Spec.new do |s| :script => <<-CMD set -e + if [[ ${CONFIGURATION} == "Debug" ]] + then + LIGHTTPD_CONFIG="Debug" + else + LIGHTTPD_CONFIG="Release" + fi + if [[ ${PLATFORM_FAMILY_NAME} == "iOS" ]] then EXTRA_CONFIG_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=${IPHONEOS_DEPLOYMENT_TARGET} -DCMAKE_SYSTEM_NAME=iOS -GXcode" - BUILD_OUTPUT_FOLDER_LIGHTTPD="/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}" + BUILD_OUTPUT_FOLDER_LIGHTTPD="/${LIGHTTPD_CONFIG}${EFFECTIVE_PLATFORM_NAME}" BUILD_OUTPUT_FOLDER_PCRE2="/Release${EFFECTIVE_PLATFORM_NAME}" else # This assumes Mac Catalyst build. @@ -73,7 +80,7 @@ Pod::Spec.new do |s| cmake ${PODS_TARGET_SRCROOT} -B ${TARGET_TEMP_DIR} \ -DBUILD_STATIC=1 -DBUILD_LIBRARY=1 ${EXTRA_CONFIG_ARGS} #{$extraCMakeArgs} - cmake --build ${TARGET_TEMP_DIR} --config ${CONFIGURATION} --target lighttpd + cmake --build ${TARGET_TEMP_DIR} --config ${LIGHTTPD_CONFIG} --target lighttpd cp ${TARGET_TEMP_DIR}/lighttpd1.4/build${BUILD_OUTPUT_FOLDER_LIGHTTPD}/*.a \ ${TARGET_TEMP_DIR}/pcre2${BUILD_OUTPUT_FOLDER_PCRE2}/*.a \ diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 903ede28..7a653f69 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1290,7 +1290,7 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 dr-pogodin-react-native-fs: 23b3d33e8789593ebce8e86516ad541b6dfd1dcd - dr-pogodin-react-native-static-server: 73a25eaba967857f96000f1c1ca23a3efd09b659 + dr-pogodin-react-native-static-server: 3dba3973415bd2d559b1b12c763b331220b1b129 FBLazyVector: 5fbbff1d7734827299274638deb8ba3024f6c597 Flipper: 6edb735e6c3e332975d1b17956bcc584eccf5818 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c diff --git a/example/ios/ReactNativeStaticServerExample.xcodeproj/project.pbxproj b/example/ios/ReactNativeStaticServerExample.xcodeproj/project.pbxproj index ed63861b..94cd9b55 100644 --- a/example/ios/ReactNativeStaticServerExample.xcodeproj/project.pbxproj +++ b/example/ios/ReactNativeStaticServerExample.xcodeproj/project.pbxproj @@ -49,6 +49,8 @@ 63A6073F29D24ECA001BB4FD /* ReactNativeStaticServerExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ReactNativeStaticServerExample-Bridging-Header.h"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ReactNativeStaticServerExample/LaunchScreen.storyboard; sourceTree = ""; }; 89C6BE57DB24E9ADA2F236DE /* Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests/Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.release.xcconfig"; sourceTree = ""; }; + A5879A435A62E4A2150F144B /* Pods-ReactNativeStaticServerExample.custom.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeStaticServerExample.custom.xcconfig"; path = "Target Support Files/Pods-ReactNativeStaticServerExample/Pods-ReactNativeStaticServerExample.custom.xcconfig"; sourceTree = ""; }; + E13E588515BBF961F1C9A26E /* Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.custom.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.custom.xcconfig"; path = "Target Support Files/Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests/Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.custom.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -154,6 +156,8 @@ 5709B34CF0A7D63546082F79 /* Pods-ReactNativeStaticServerExample.release.xcconfig */, 5B7EB9410499542E8C5724F5 /* Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.debug.xcconfig */, 89C6BE57DB24E9ADA2F236DE /* Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.release.xcconfig */, + A5879A435A62E4A2150F144B /* Pods-ReactNativeStaticServerExample.custom.xcconfig */, + E13E588515BBF961F1C9A26E /* Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.custom.xcconfig */, ); path = Pods; sourceTree = ""; @@ -585,6 +589,156 @@ }; name = Release; }; + 63D0B8FA2B07B60E003B38D4 /* Custom */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION, + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/lib/swift\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CFLAGS = ( + "$(inherited)", + "-DRN_FABRIC_ENABLED", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-DFOLLY_NO_CONFIG", + "-DFOLLY_MOBILE=1", + "-DFOLLY_USE_LIBCPP=1", + "-DRN_FABRIC_ENABLED", + ); + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Custom; + }; + 63D0B8FB2B07B60E003B38D4 /* Custom */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A5879A435A62E4A2150F144B /* Pods-ReactNativeStaticServerExample.custom.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = ReactNativeStaticServerExample/ReactNativeStaticServerExample.entitlements; + CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_TEAM = 7TTF2KGYQU; + INFOPLIST_FILE = ReactNativeStaticServerExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(SDKROOT)/usr/lib/swift", + "$(SDKROOT)/System/iOSSupport/usr/lib/swift", + "$(inherited)", + ); + MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES; + PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = ReactNativeStaticServerExample; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SWIFT_OBJC_BRIDGING_HEADER = "ReactNativeStaticServerExample-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Custom; + }; + 63D0B8FC2B07B60E003B38D4 /* Custom */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E13E588515BBF961F1C9A26E /* Pods-ReactNativeStaticServerExample-ReactNativeStaticServerExampleTests.custom.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + INFOPLIST_FILE = ReactNativeStaticServerExampleTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(SDKROOT)/usr/lib/swift", + "$(SDKROOT)/System/iOSSupport/usr/lib/swift", + "$(inherited)", + ); + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + "$(inherited)", + ); + PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES; + PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeStaticServerExample.app/ReactNativeStaticServerExample"; + }; + name = Custom; + }; 83CBBA201A601CBA00E9B192 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -755,6 +909,7 @@ buildConfigurations = ( 00E356F61AD99517003FC87E /* Debug */, 00E356F71AD99517003FC87E /* Release */, + 63D0B8FC2B07B60E003B38D4 /* Custom */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -764,6 +919,7 @@ buildConfigurations = ( 13B07F941A680F5B00A75B9A /* Debug */, 13B07F951A680F5B00A75B9A /* Release */, + 63D0B8FB2B07B60E003B38D4 /* Custom */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -773,6 +929,7 @@ buildConfigurations = ( 83CBBA201A601CBA00E9B192 /* Debug */, 83CBBA211A601CBA00E9B192 /* Release */, + 63D0B8FA2B07B60E003B38D4 /* Custom */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/example/ios/ReactNativeStaticServerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeStaticServerExample.xcscheme b/example/ios/ReactNativeStaticServerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeStaticServerExample.xcscheme index 37dcaf42..3d7f4516 100644 --- a/example/ios/ReactNativeStaticServerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeStaticServerExample.xcscheme +++ b/example/ios/ReactNativeStaticServerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeStaticServerExample.xcscheme @@ -41,7 +41,7 @@