//
//  CommonConfig.xcconfig
//  TeamViewer
//
//  Created by Markus Wittlinger on 7/3/13.
//  Copyright (c) 2013 TeamViewer GmbH. All rights reserved.
//

// Architectures
ARCHS = x86_64
VALID_ARCHS = x86_64
SDKROOT = macosx10.13

// Build options
GCC_VERSION = com.apple.compilers.llvm.clang.1_0

// Deployment
MACOSX_DEPLOYMENT_TARGET = 10.10.3
SKIP_INSTALL = YES
COPY_PHASE_STRIP = NO

// Linking
DEAD_CODE_STRIPPING = NO

// Search paths
ALWAYS_SEARCH_USER_PATHS = NO

// Code generation
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
GCC_SYMBOLS_PRIVATE_EXTERN = YES
GCC_NO_COMMON_BLOCKS = YES

// Language
CLANG_CXX_LANGUAGE_STANDARD = c++14
CLANG_CXX_LIBRARY = libc++

CLANG_ENABLE_MODULES = YES
CLANG_MODULES_AUTOLINK = YES
GCC_C_LANGUAGE_STANDARD = c11
GCC_PRECOMPILE_PREFIX_HEADER = YES

// Language Objective C
CLANG_ENABLE_OBJC_ARC[arch=x86_64] = YES

// Preprocessing
ENABLE_STRICT_OBJC_MSGSEND = YES

// Warnings
//CLANG_WARN_DOCUMENTATION_COMMENTS = YES // Disabled for now since the code is full of errors.
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_EMPTY_BODY = YES
CLANG_WARN_ENUM_CONVERSION = YES
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES
CLANG_WARN_INFINITE_RECURSION = YES
CLANG_WARN_INT_CONVERSION = YES
CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
CLANG_WARN_OBJC_RECEIVER_WEAK = YES
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES
CLANG_WARN_STRICT_PROTOTYPES = YES
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
CLANG_WARN_SUSPICIOUS_MOVE = YES
CLANG_WARN_UNREACHABLE_CODE = YES
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES
GCC_WARN_SHADOW = YES
GCC_WARN_SIGN_COMPARE = YES
GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES
GCC_WARN_UNKNOWN_PRAGMAS = YES
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_LABEL = YES
GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_UNUSED_VALUE = YES
GCC_WARN_UNUSED_VARIABLE = YES

TV_BASE_WARNING_FLAGS_0800 = -Weverything -Wall -Wextra -Wextra-tokens -Wformat-security -Winit-self -Wswitch-default -Wfloat-equal -Wpointer-arith -Wredundant-decls -Winvalid-pch -Wdisabled-optimization -Wno-variadic-macros -Wno-documentation -Wno-padded -Wno-objc-missing-property-synthesis -Wno-gnu -Wno-switch-enum -Wno-#pragma-messages -Reverything -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-documentation-pedantic -Rno-remark-backend-plugin
TV_BASE_WARNING_FLAGS_0900 = -Weverything -Wall -Wextra -Wextra-tokens -Wformat-security -Winit-self -Wswitch-default -Wfloat-equal -Wpointer-arith -Wredundant-decls -Winvalid-pch -Wdisabled-optimization -Wno-variadic-macros -Wno-documentation -Wno-padded -Wno-objc-missing-property-synthesis -Wno-gnu -Wno-switch-enum -Wno-#pragma-messages -Reverything -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-documentation-pedantic -Rno-remark-backend-plugin -Rno-index-store
TV_BASE_WARNING_FLAGS=$(TV_BASE_WARNING_FLAGS_$(XCODE_VERSION_MAJOR))

OTHER_CFLAGS = ${TV_BASE_C_FLAGS} ${TV_BASE_WARNING_FLAGS} -Wno-auto-import -Wno-assign-enum -Wno-gnu-statement-expression -Rno-module-build
OTHER_CPLUSPLUSFLAGS = ${TV_BASE_C_FLAGS} ${TV_BASE_WARNING_FLAGS} -Wno-tautological-compare -Wno-c++98-compat-pedantic -Wno-global-constructors -Wno-disabled-macro-expansion -Wno-weak-vtables -Wno-weak-template-vtables -Wno-covered-switch-default

// Static analyzer
CLANG_ANALYZER_NONNULL = YES
CLANG_ANALYZER_DEADCODE_DEADSTORES = YES
CLANG_ANALYZER_OTHER_FLAGS = -analyzer-checker osx.cocoa.Dealloc -analyzer-checker alpha.core.BoolAssignment -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker osx.cocoa.AtSync -analyzer-checker osx.cocoa.Loops -analyzer-checker osx.cocoa.NonNilReturnValue -analyzer-checker osx.cocoa.VariadicMethodTypes

// Preprocessor macros
BASE_GCC_PREPROCESSOR_DEFINITIONS = TVOS_OSX
