Skip to content

Commit facf2ba

Browse files
committed
Simplify Xcode's build settings on project and target level by using xcconfigs.
Since xcconfigs can include other configs you get the same functionality that Xcode's build settings give you but with much more clarity. And it's much better for SCM, especially decentralized ones like git. Changes: - Archs is set to ppc i386 x86_64 - libgit2 is now compiled including -arch x86_64. - LTO is off (caused a Rel32 address space error when linking) - Default compiler is now LLVM GCC4.2 since Clang is not quite ready for Objective C++. (and we have some .mm files in there) - Based on: settings on Xcode's build settings dialogs are set according to the name of the xcconfig file. (project settings are based on Common.xcconfig) - Deleted all the overwritten settings (bold font display) that are now defined through the xcconfigs.
1 parent e004c64 commit facf2ba

File tree

5 files changed

+143
-72
lines changed

5 files changed

+143
-72
lines changed

Common.xcconfig

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//
2+
// Common.xcconfig
3+
// GitX
4+
//
5+
// Created by Andre Berg on 25.03.10.
6+
// Copyright 2010 Berg Media. All rights reserved.
7+
//
8+
// Licensed under the Apache License, Version 2.0 (the "License");
9+
// you may not use this file except in compliance with the License.
10+
// You may obtain a copy of the License at
11+
//
12+
// http://www.apache.org/licenses/LICENSE-2.0
13+
//
14+
// Unless required by applicable law or agreed to in writing, software
15+
// distributed under the License is distributed on an "AS IS" BASIS,
16+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
// See the License for the specific language governing permissions and
18+
// limitations under the License.
19+
20+
// Archs and Target SDKs
21+
22+
ARCHS = ppc i386 x86_64
23+
SDKROOT = macosx10.5
24+
MACOSX_DEPLOYMENT_TARGET = 10.5
25+
26+
// Search Paths
27+
28+
HEADER_SEARCH_PATHS = libgit2/src
29+
LIBRARY_SEARCH_PATHS = libgit2
30+
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SRCROOT)"
31+
32+
// Info.plist
33+
34+
INFOPLIST_PREPROCESS = YES
35+
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = -traditional
36+
INFOPLIST_FILE = Info.plist
37+
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision // needed for the `git describe --long` output in the about dialog
38+
39+
// Compiler
40+
41+
GCC_ENABLE_OBJC_GC = required
42+
// GCC_VERSION = // System Default (GCC 4.2)
43+
GCC_VERSION = com.apple.compilers.llvmgcc42 // LLVM GCC 4.2
44+
// GCC_VERSION = com.apple.compilers.llvm.clang.1_0 // Clang LLVM 1.0
45+
GCC_C_LANGUAGE_STANDARD = gnu99
46+
47+
// Prefix Header
48+
49+
GCC_PRECOMPILE_PREFIX_HEADER = YES
50+
GCC_PREFIX_HEADER = GitX_Prefix.pch
51+
52+
// Linking
53+
54+
PREBINDING = NO
55+
ZERO_LINK = NO // this is no longer needed
56+
57+
// Other
58+
59+
LLVM_LTO = NO // Link-Time Optimization causes a Rel32 address space error when linking (since we now target x86_64 inclusively)
60+

Debug.xcconfig

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// Debug.xcconfig
3+
// GitX
4+
//
5+
// Created by Andre Berg on 25.03.10.
6+
// Copyright 2010 Berg Media. All rights reserved.
7+
//
8+
// Licensed under the Apache License, Version 2.0 (the "License");
9+
// you may not use this file except in compliance with the License.
10+
// You may obtain a copy of the License at
11+
//
12+
// http://www.apache.org/licenses/LICENSE-2.0
13+
//
14+
// Unless required by applicable law or agreed to in writing, software
15+
// distributed under the License is distributed on an "AS IS" BASIS,
16+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
// See the License for the specific language governing permissions and
18+
// limitations under the License.
19+
20+
#include "Common.xcconfig"
21+
22+
// Macros
23+
24+
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD
25+
26+
OTHER_CFLAGS = -fdiagnostics-show-option
27+
28+
// Warnings
29+
30+
GCC_WARN_UNUSED_VARIABLE = YES
31+
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
32+
GCC_WARN_ABOUT_RETURN_TYPE = YES
33+

GitX.xcodeproj/project.pbxproj

+21-71
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@
3030
47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */; };
3131
551BF11E112F376C00265053 /* gitx_askpasswd_main.m in Sources */ = {isa = PBXBuildFile; fileRef = 551BF11D112F376C00265053 /* gitx_askpasswd_main.m */; };
3232
551BF176112F3F4B00265053 /* gitx_askpasswd in Resources */ = {isa = PBXBuildFile; fileRef = 551BF111112F371800265053 /* gitx_askpasswd */; };
33+
6501ABC1115C064A00171062 /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 6501ABC0115C064A00171062 /* Release.xcconfig */; };
3334
653D930A109BEAFE00B26705 /* PBGitXErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = 653D9309109BEAFE00B26705 /* PBGitXErrors.m */; };
3435
654D16E8108C6CA6008D960C /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; };
3536
654FEFA0115A2684004C8721 /* NSString_Truncate.m in Sources */ = {isa = PBXBuildFile; fileRef = 654FEF9F115A2684004C8721 /* NSString_Truncate.m */; };
3637
6552BA27109C4CA8003B4892 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 47DBDB690E94EF6500671A1E /* Preferences.xib */; };
38+
65604690115BF80F0021E246 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 6560468F115BF80F0021E246 /* Debug.xcconfig */; };
39+
656F3B0B115C042D00CA816E /* Common.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 656F3B0A115C042D00CA816E /* Common.xcconfig */; };
3740
65C77FA0108BF560003BD3B5 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65C77F9F108BF560003BD3B5 /* Quartz.framework */; };
3841
65F3544011599F3100235D5B /* AddRemoteBranchTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 65A102F110A7D9FE0033C593 /* AddRemoteBranchTemplate.png */; };
3942
65F3555B1159A95700235D5B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F3555A1159A95700235D5B /* MainMenu.xib */; };
@@ -243,13 +246,16 @@
243246
47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBNSURLPathUserDefaultsTransfomer.m; sourceTree = "<group>"; };
244247
551BF111112F371800265053 /* gitx_askpasswd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gitx_askpasswd; sourceTree = BUILT_PRODUCTS_DIR; };
245248
551BF11D112F376C00265053 /* gitx_askpasswd_main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = gitx_askpasswd_main.m; sourceTree = "<group>"; };
249+
6501ABC0115C064A00171062 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
246250
653D9308109BEAFE00B26705 /* PBGitXErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitXErrors.h; sourceTree = "<group>"; };
247251
653D9309109BEAFE00B26705 /* PBGitXErrors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitXErrors.m; sourceTree = "<group>"; };
248252
654D17E7108C90E8008D960C /* html */ = {isa = PBXFileReference; lastKnownFileType = folder; path = html; sourceTree = "<group>"; };
249253
654D18EF108C9597008D960C /* Install.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Install.xcconfig; sourceTree = "<group>"; };
250254
654D18F6108C96CB008D960C /* install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = install.sh; sourceTree = "<group>"; };
251255
654FEF9F115A2684004C8721 /* NSString_Truncate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_Truncate.m; sourceTree = "<group>"; };
252256
654FEFAF115A2747004C8721 /* NSString_Truncate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_Truncate.h; sourceTree = "<group>"; };
257+
6560468F115BF80F0021E246 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
258+
656F3B0A115C042D00CA816E /* Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = "<group>"; };
253259
65A102F110A7D9FE0033C593 /* AddRemoteBranchTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemoteBranchTemplate.png; path = Images/AddRemoteBranchTemplate.png; sourceTree = "<group>"; };
254260
65C77F9F108BF560003BD3B5 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; };
255261
770B37EC0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = GitTest_DataModel.xcdatamodel; sourceTree = "<group>"; };
@@ -616,6 +622,9 @@
616622
654D18EE108C9589008D960C /* Config */ = {
617623
isa = PBXGroup;
618624
children = (
625+
656F3B0A115C042D00CA816E /* Common.xcconfig */,
626+
6560468F115BF80F0021E246 /* Debug.xcconfig */,
627+
6501ABC0115C064A00171062 /* Release.xcconfig */,
619628
654D18EF108C9597008D960C /* Install.xcconfig */,
620629
);
621630
name = Config;
@@ -1133,6 +1142,9 @@
11331142
D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */,
11341143
D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */,
11351144
F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */,
1145+
65604690115BF80F0021E246 /* Debug.xcconfig in Resources */,
1146+
656F3B0B115C042D00CA816E /* Common.xcconfig in Resources */,
1147+
6501ABC1115C064A00171062 /* Release.xcconfig in Resources */,
11361148
);
11371149
runOnlyForDeploymentPostprocessing = 0;
11381150
};
@@ -1192,7 +1204,7 @@
11921204
);
11931205
runOnlyForDeploymentPostprocessing = 0;
11941206
shellPath = /bin/sh;
1195-
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a\nmake CFLAGS=\"-arch i386 -arch ppc\"\nranlib libgit2.a";
1207+
shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a\nmake CFLAGS=\"-arch i386 -arch ppc -arch x86_64\"\nranlib libgit2.a";
11961208
};
11971209
F5CF04A20EAE696C00D75C81 /* Copy HTML files */ = {
11981210
isa = PBXShellScriptBuildPhase;
@@ -1456,92 +1468,48 @@
14561468
/* Begin XCBuildConfiguration section */
14571469
26FC0A850875C7B200E6366F /* Debug */ = {
14581470
isa = XCBuildConfiguration;
1471+
baseConfigurationReference = 6560468F115BF80F0021E246 /* Debug.xcconfig */;
14591472
buildSettings = {
14601473
COPY_PHASE_STRIP = NO;
1461-
FRAMEWORK_SEARCH_PATHS = (
1462-
"$(inherited)",
1463-
"\"$(SRCROOT)\"",
1464-
);
14651474
GCC_DYNAMIC_NO_PIC = NO;
14661475
GCC_ENABLE_FIX_AND_CONTINUE = YES;
1467-
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
14681476
GCC_MODEL_TUNING = G5;
14691477
GCC_OPTIMIZATION_LEVEL = 0;
14701478
GCC_PRECOMPILE_PREFIX_HEADER = YES;
14711479
GCC_PREFIX_HEADER = GitX_Prefix.pch;
1472-
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
1473-
HEADER_SEARCH_PATHS = libgit2/src;
1474-
INFOPLIST_FILE = Info.plist;
1475-
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
1476-
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
1477-
INFOPLIST_PREPROCESS = YES;
14781480
INSTALL_PATH = "$(HOME)/Applications";
1479-
LIBRARY_SEARCH_PATHS = libgit2;
14801481
PRODUCT_NAME = GitX;
1481-
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
1482-
WARNING_CFLAGS = "-Wno-deprecated-declarations";
14831482
WRAPPER_EXTENSION = app;
1484-
ZERO_LINK = NO;
14851483
};
14861484
name = Debug;
14871485
};
14881486
26FC0A860875C7B200E6366F /* Release */ = {
14891487
isa = XCBuildConfiguration;
1488+
baseConfigurationReference = 6501ABC0115C064A00171062 /* Release.xcconfig */;
14901489
buildSettings = {
1491-
DEBUG_INFORMATION_FORMAT = dwarf;
1492-
FRAMEWORK_SEARCH_PATHS = (
1493-
"$(inherited)",
1494-
"\"$(SRCROOT)\"",
1495-
);
1496-
GCC_C_LANGUAGE_STANDARD = gnu99;
1497-
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
14981490
GCC_MODEL_TUNING = G5;
1499-
GCC_PRECOMPILE_PREFIX_HEADER = YES;
1500-
GCC_PREFIX_HEADER = GitX_Prefix.pch;
1501-
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "";
1502-
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
1503-
HEADER_SEARCH_PATHS = libgit2/src;
1504-
INFOPLIST_FILE = Info.plist;
1505-
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
1506-
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
1507-
INFOPLIST_PREPROCESS = YES;
15081491
INSTALL_PATH = "$(HOME)/Applications";
1509-
LIBRARY_SEARCH_PATHS = libgit2;
1510-
LLVM_LTO = YES;
15111492
PRODUCT_NAME = GitX;
15121493
WRAPPER_EXTENSION = app;
15131494
};
15141495
name = Release;
15151496
};
15161497
26FC0A890875C7B200E6366F /* Debug */ = {
15171498
isa = XCBuildConfiguration;
1499+
baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */;
15181500
buildSettings = {
1519-
GCC_ENABLE_OBJC_GC = required;
1520-
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD;
1521-
GCC_VERSION = com.apple.compilers.llvmgcc42;
1522-
GCC_WARN_ABOUT_RETURN_TYPE = YES;
1523-
GCC_WARN_UNUSED_VARIABLE = YES;
1524-
INFOPLIST_PREPROCESS = YES;
1525-
PREBINDING = NO;
1526-
SDKROOT = macosx10.5;
15271501
};
15281502
name = Debug;
15291503
};
15301504
26FC0A8A0875C7B200E6366F /* Release */ = {
15311505
isa = XCBuildConfiguration;
1506+
baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */;
15321507
buildSettings = {
1533-
ARCHS = (
1534-
ppc,
1535-
i386,
1536-
);
1537-
GCC_ENABLE_OBJC_GC = required;
1538-
GCC_VERSION = com.apple.compilers.llvmgcc42;
15391508
GCC_WARN_ABOUT_RETURN_TYPE = YES;
15401509
GCC_WARN_UNUSED_VARIABLE = YES;
15411510
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
15421511
INFOPLIST_PREPROCESS = YES;
15431512
PREBINDING = NO;
1544-
SDKROOT = macosx10.5;
15451513
};
15461514
name = Release;
15471515
};
@@ -1613,49 +1581,31 @@
16131581
};
16141582
654D1896108C9293008D960C /* Install */ = {
16151583
isa = XCBuildConfiguration;
1584+
baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */;
16161585
buildSettings = {
16171586
ARCHS = (
16181587
ppc,
16191588
i386,
1589+
x86_64,
16201590
);
1591+
GCC_C_LANGUAGE_STANDARD = gnu99;
16211592
GCC_ENABLE_OBJC_GC = required;
1622-
GCC_VERSION = com.apple.compilers.llvmgcc42;
16231593
GCC_WARN_ABOUT_RETURN_TYPE = YES;
16241594
GCC_WARN_UNUSED_VARIABLE = YES;
16251595
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
16261596
INFOPLIST_PREPROCESS = YES;
16271597
PREBINDING = NO;
1628-
SDKROOT = macosx10.5;
1598+
SDKROOT = macosx10.6;
16291599
};
16301600
name = Install;
16311601
};
16321602
654D1897108C9293008D960C /* Install */ = {
16331603
isa = XCBuildConfiguration;
16341604
baseConfigurationReference = 654D18EF108C9597008D960C /* Install.xcconfig */;
16351605
buildSettings = {
1636-
DEBUG_INFORMATION_FORMAT = dwarf;
1637-
DEPLOYMENT_LOCATION = NO;
1638-
DEPLOYMENT_POSTPROCESSING = YES;
1639-
FRAMEWORK_SEARCH_PATHS = (
1640-
"$(inherited)",
1641-
"\"$(SRCROOT)\"",
1642-
);
1643-
GCC_C_LANGUAGE_STANDARD = gnu99;
16441606
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
16451607
GCC_MODEL_TUNING = G5;
1646-
GCC_PRECOMPILE_PREFIX_HEADER = YES;
1647-
GCC_PREFIX_HEADER = GitX_Prefix.pch;
1648-
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
1649-
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
1650-
HEADER_SEARCH_PATHS = libgit2/src;
1651-
INFOPLIST_FILE = Info.plist;
1652-
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional";
1653-
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
1654-
INFOPLIST_PREPROCESS = YES;
1655-
LIBRARY_SEARCH_PATHS = libgit2;
1656-
LLVM_LTO = YES;
16571608
PRODUCT_NAME = GitX;
1658-
STRIP_INSTALLED_PRODUCT = YES;
16591609
WRAPPER_EXTENSION = app;
16601610
};
16611611
name = Install;

Install.xcconfig

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,10 @@
1919

2020
// Global settings across build configurations for Install
2121

22-
CUSTOM_INSTALL_DIR = ${DEVELOPER_DIR}/Applications/Utilities/Third-Party
22+
#include "Release.xcconfig"
23+
24+
CUSTOM_INSTALL_DIR = $(DEVELOPER_DIR)/Applications/Utilities/Third-Party // used with the Install.sh script
25+
26+
DEPLOYMENT_POSTPROCESSING = YES
27+
28+
STRIP_INSTALLED_PRODUCT = YES

Release.xcconfig

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// Release.xcconfig
3+
// GitX
4+
//
5+
// Created by Andre Berg on 25.03.10.
6+
// Copyright 2010 Berg Media. All rights reserved.
7+
//
8+
// Licensed under the Apache License, Version 2.0 (the "License");
9+
// you may not use this file except in compliance with the License.
10+
// You may obtain a copy of the License at
11+
//
12+
// http://www.apache.org/licenses/LICENSE-2.0
13+
//
14+
// Unless required by applicable law or agreed to in writing, software
15+
// distributed under the License is distributed on an "AS IS" BASIS,
16+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
// See the License for the specific language governing permissions and
18+
// limitations under the License.
19+
20+
#include "Common.xcconfig"
21+
22+
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym

0 commit comments

Comments
 (0)