Quellcode durchsuchen

Restructure and update all configurations. (#12)

Nikita Lutsenko vor 9 Jahren
Ursprung
Commit
7d6009a8e1

+ 27 - 5
Configurations/Common.xcconfig

@@ -9,13 +9,35 @@
 
 #include "Warnings.xcconfig"
 
-// Language Settings
+// Disable legacy-compatible header searching
+ALWAYS_SEARCH_USER_PATHS = NO
+
+// Architectures to build
+ARCHS = $(ARCHS_STANDARD)
+
+// Whether to enable module imports
+CLANG_ENABLE_MODULES = YES
+CLANG_ENABLE_MODULE_DEBUGGING = NO
+
+// Build Options
 CLANG_ENABLE_OBJC_ARC = YES
+GCC_VERSION = com.apple.compilers.llvm.clang.1_0
+
+// Whether to strip out code that isn't called from anywhere
+DEAD_CODE_STRIPPING = NO
+
+// The format of debugging symbols
+DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
+
+// C Language
 GCC_C_LANGUAGE_STANDARD = gnu11
+
+// C++ Language
 CLANG_CXX_LANGUAGE_STANDARD = gnu++14
 CLANG_CXX_LIBRARY = libc++
 
-// Search Paths
-PARSE_DIR = $(PROJECT_DIR)
-VENDOR_DIR = $(PARSE_DIR)/Vendor
-ALWAYS_SEARCH_USER_PATHS = NO
+// Code Generation
+GCC_DYNAMIC_NO_PIC = NO
+GCC_INLINES_ARE_PRIVATE_EXTERN = YES
+GCC_NO_COMMON_BLOCKS = YES
+GCC_SYMBOLS_PRIVATE_EXTERN = NO

+ 6 - 8
Configurations/Platform/iOS.xcconfig

@@ -7,15 +7,13 @@
 // of patent rights can be found in the PATENTS file in the same directory.
 //
 
-SDKROOT = iphoneos
-IPHONEOS_DEPLOYMENT_TARGET = 7.0
-
-GCC_THUMB_SUPPORT = NO
-
 ARCHS = $(ARCHS_STANDARD) armv7s
-DSTROOT = /tmp/$(PRODUCT_NAME).dst
 
-CODE_SIGN_IDENTITY =
-CODE_SIGNING_REQUIRED = NO
+SDKROOT = iphoneos
+IPHONEOS_DEPLOYMENT_TARGET = 7.0
 
+// Supported device families (1 is iPhone, 2 is iPad, 3 is Apple TV)
 TARGETED_DEVICE_FAMILY = 1,2
+
+// Where to find embedded frameworks
+LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks

+ 3 - 0
Configurations/Platform/OSX.xcconfig → Configurations/Platform/macOS.xcconfig

@@ -9,3 +9,6 @@
 
 SDKROOT = macosx
 MACOSX_DEPLOYMENT_TARGET = 10.9
+
+// Where to find embedded frameworks
+LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks

+ 5 - 2
Configurations/Platform/tvOS.xcconfig

@@ -10,5 +10,8 @@
 SDKROOT = appletvos
 TVOS_DEPLOYMENT_TARGET = 9.0
 
-CODE_SIGN_IDENTITY =
-CODE_SIGNING_REQUIRED = NO
+// Supported device families (1 is iPhone, 2 is iPad, 3 is Apple TV)
+TARGETED_DEVICE_FAMILY = 3
+
+// Where to find embedded frameworks
+LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks

+ 5 - 2
Configurations/Platform/watchOS.xcconfig

@@ -10,5 +10,8 @@
 SDKROOT = watchos
 WATCHOS_DEPLOYMENT_TARGET = 2.0
 
-CODE_SIGN_IDENTITY =
-CODE_SIGNING_REQUIRED = NO
+// Supported device families (1 is iPhone, 2 is iPad, 3 is Apple TV, 4 is watch)
+TARGETED_DEVICE_FAMILY = 4
+
+// Where to find embedded frameworks
+LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks

+ 4 - 2
Configurations/Product/Application.xcconfig

@@ -7,8 +7,10 @@
 // of patent rights can be found in the PATENTS file in the same directory.
 //
 
-LD_RUNPATH_SEARCH_PATHS = @executable_path/Frameworks
+// Whether to strip out code that isn't called from anywhere
+DEAD_CODE_STRIPPING = NO
 
 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage
-CLANG_ENABLE_MODULES = YES
+
+LD_RUNPATH_SEARCH_PATHS = $(inherited) @loader_path/Frameworks @executable_path/Frameworks

+ 26 - 0
Configurations/Product/DynamicFramework.xcconfig

@@ -0,0 +1,26 @@
+//
+// Copyright (c) 2015-present, Parse, LLC.
+// All rights reserved.
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree. An additional grant
+// of patent rights can be found in the PATENTS file in the same directory.
+//
+
+// Dynamic frameworks are backed by dynamic library.
+MACH_O_TYPE = mh_dylib
+
+// Whether this framework should define an LLVM module
+DEFINES_MODULE = YES
+
+// Disable clang modules autolink
+CLANG_MODULES_AUTOLINK = NO
+
+// Whether to strip out code that isn't called from anywhere
+DEAD_CODE_STRIPPING = NO
+
+// Whether function calls should be position-dependent (should always be disabled for shared code)
+GCC_DYNAMIC_NO_PIC = NO
+
+// Don't include in an xcarchive
+SKIP_INSTALL = YES

+ 0 - 19
Configurations/Product/Framework.xcconfig

@@ -1,19 +0,0 @@
-//
-// Copyright (c) 2015-present, Parse, LLC.
-// All rights reserved.
-//
-// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree. An additional grant
-// of patent rights can be found in the PATENTS file in the same directory.
-//
-
-ENABLE_NS_ASSERTIONS = NO
-MTL_ENABLE_DEBUG_INFO = NO
-
-DYLIB_COMPATIBILITY_VERSION = 1
-DYLIB_CURRENT_VERSION = 1
-
-SKIP_INSTALL = YES
-
-CLANG_MODULES_AUTOLINK = NO
-CLANG_ENABLE_MODULES = YES

+ 2 - 3
Configurations/Product/UnitTest.xcconfig → Configurations/Product/LogicTests.xcconfig

@@ -7,9 +7,8 @@
 // of patent rights can be found in the PATENTS file in the same directory.
 //
 
-OTHER_LDFLAGS = $(inherited) -ObjC -framework XCTest
 BUNDLE_LOADER = $(TEST_HOST)
 
+OTHER_LDFLAGS = $(inherited) -ObjC -framework XCTest
+
 LD_RUNPATH_SEARCH_PATHS = $(inherited) @loader_path/Frameworks @executable_path/Frameworks
-USER_HEADER_SEARCH_PATHS = $(value) $(PARSE_DIR)/Tests/**
-CLANG_ENABLE_MODULES = YES

+ 30 - 0
Configurations/Product/StaticFramework.xcconfig

@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2015-present, Parse, LLC.
+// All rights reserved.
+//
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree. An additional grant
+// of patent rights can be found in the PATENTS file in the same directory.
+//
+
+// Static frameworks are backed by static libraries
+MACH_O_TYPE = staticlib
+
+// Whether this framework should define an LLVM module
+DEFINES_MODULE = YES
+
+// Disable clang modules autolink
+CLANG_MODULES_AUTOLINK = NO
+
+// Whether to strip out code that isn't called from anywhere
+DEAD_CODE_STRIPPING = NO
+
+// Whether function calls should be position-dependent (should always be disabled for shared code)
+GCC_DYNAMIC_NO_PIC = NO
+
+// Enables the framework to be included from any location as long as the loader’s runpath search paths includes it.
+// For example from an application bundle (inside the "Frameworks" folder) or shared folder
+INSTALL_PATH = @rpath
+
+// Don't include in an xcarchive
+SKIP_INSTALL = YES

+ 11 - 2
Configurations/Project/Debug.xcconfig

@@ -9,14 +9,23 @@
 
 #include "../Common.xcconfig"
 
+// Architectures
+ONLY_ACTIVE_ARCH = YES
+
+// Optimization
 GCC_OPTIMIZATION_LEVEL = 0
 SWIFT_OPTIMIZATION_LEVEL = -Onone
 
-GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
-ONLY_ACTIVE_ARCH = YES
+// Preprocessor
+GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited)
+ENABLE_NS_ASSERTIONS = YES
 
+// Testability
 ENABLE_TESTABILITY = YES
 
+// Deployment 
+COPY_PHASE_STRIP = NO
+
 SANITIZE_FLAGS = -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap
 OTHER_CFLAGS = $(value) $(SANITIZE_FLAGS)
 OTHER_LDFLAGS = $(value) $(SANITIZE_FLAGS)

+ 12 - 1
Configurations/Project/Release.xcconfig

@@ -9,10 +9,21 @@
 
 #include "../Common.xcconfig"
 
+// Architectures
+ONLY_ACTIVE_ARCH = NO
+
+// Build
+VALIDATE_PRODUCT = YES
+
+// Optimization
 GCC_OPTIMIZATION_LEVEL = s
 SWIFT_OPTIMIZATION_LEVEL = -O
 
-VALIDATE_PRODUCT = YES
+// Preprocessor
+ENABLE_NS_ASSERTIONS = NO
 
+// Deployment
 DEPLOYMENT_POSTPROCESSING = YES
+COPY_PHASE_STRIP = YES
 STRIP_STYLE = debugging
+STRIP_INSTALLED_PRODUCT = YES

+ 4 - 0
Configurations/Warnings.xcconfig

@@ -24,10 +24,13 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
 GCC_WARN_UNDECLARED_SELECTOR = YES
 GCC_WARN_64_TO_32_BIT_CONVERSION = YES
 GCC_WARN_UNINITIALIZED_AUTOS = YES
+GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
+GCC_WARN_SHADOW = YES
 
 CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
 CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
 CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES
+CLANG_WARN_BOOL_CONVERSION = YES
 CLANG_WARN_CONSTANT_CONVERSION = YES
 CLANG_WARN_DOCUMENTATION_COMMENTS = YES
 CLANG_WARN_EMPTY_BODY = YES
@@ -36,6 +39,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES
 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
 CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
 CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
+CLANG_WARN_BOOL_CONVERSION = YES
 
 // Errors
 GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR