Skip to content

Commit e58d1ea

Browse files
authored
[WIP] XCode - Extra Sources / Local Addons fix (#510)
1 parent 5cd3d8d commit e58d1ea

18 files changed

Lines changed: 1821 additions & 1729 deletions

.clang-format

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: WebKit
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: DontAlign
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveAssignments:
8+
Enabled: false
9+
AcrossEmptyLines: false
10+
AcrossComments: false
11+
AlignCompound: false
12+
PadOperators: true
13+
AlignConsecutiveBitFields:
14+
Enabled: false
15+
AcrossEmptyLines: false
16+
AcrossComments: false
17+
AlignCompound: false
18+
PadOperators: false
19+
AlignConsecutiveDeclarations:
20+
Enabled: false
21+
AcrossEmptyLines: false
22+
AcrossComments: false
23+
AlignCompound: false
24+
PadOperators: false
25+
AlignConsecutiveMacros:
26+
Enabled: false
27+
AcrossEmptyLines: false
28+
AcrossComments: false
29+
AlignCompound: false
30+
PadOperators: false
31+
AlignEscapedNewlines: Right
32+
AlignOperands: DontAlign
33+
AlignTrailingComments: false
34+
AllowAllArgumentsOnNextLine: true
35+
AllowAllParametersOfDeclarationOnNextLine: true
36+
AllowShortEnumsOnASingleLine: true
37+
AllowShortBlocksOnASingleLine: Empty
38+
AllowShortCaseLabelsOnASingleLine: false
39+
AllowShortFunctionsOnASingleLine: All
40+
AllowShortLambdasOnASingleLine: All
41+
AllowShortIfStatementsOnASingleLine: WithoutElse
42+
AllowShortLoopsOnASingleLine: false
43+
AlwaysBreakAfterDefinitionReturnType: None
44+
AlwaysBreakAfterReturnType: None
45+
AlwaysBreakBeforeMultilineStrings: false
46+
AlwaysBreakTemplateDeclarations: MultiLine
47+
AttributeMacros:
48+
- __capability
49+
BinPackArguments: true
50+
BinPackParameters: true
51+
BraceWrapping:
52+
AfterCaseLabel: false
53+
AfterClass: false
54+
AfterControlStatement: Never
55+
AfterEnum: false
56+
AfterFunction: false
57+
AfterNamespace: false
58+
AfterObjCDeclaration: false
59+
AfterStruct: false
60+
AfterUnion: false
61+
AfterExternBlock: false
62+
BeforeCatch: false
63+
BeforeElse: false
64+
BeforeLambdaBody: false
65+
BeforeWhile: false
66+
IndentBraces: false
67+
SplitEmptyFunction: true
68+
SplitEmptyRecord: true
69+
SplitEmptyNamespace: true
70+
BreakBeforeBinaryOperators: All
71+
BreakBeforeConceptDeclarations: Always
72+
BreakBeforeBraces: Custom
73+
BreakBeforeInheritanceComma: false
74+
BreakInheritanceList: BeforeColon
75+
BreakBeforeTernaryOperators: true
76+
BreakConstructorInitializersBeforeComma: false
77+
BreakConstructorInitializers: BeforeComma
78+
BreakAfterJavaFieldAnnotations: false
79+
BreakStringLiterals: true
80+
ColumnLimit: 0
81+
CommentPragmas: '^ IWYU pragma:'
82+
QualifierAlignment: Leave
83+
CompactNamespaces: false
84+
ConstructorInitializerIndentWidth: 4
85+
ContinuationIndentWidth: 4
86+
Cpp11BracedListStyle: false
87+
DeriveLineEnding: true
88+
DerivePointerAlignment: false
89+
DisableFormat: false
90+
EmptyLineAfterAccessModifier: Never
91+
EmptyLineBeforeAccessModifier: LogicalBlock
92+
ExperimentalAutoDetectBinPacking: false
93+
PackConstructorInitializers: BinPack
94+
BasedOnStyle: ''
95+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
96+
AllowAllConstructorInitializersOnNextLine: true
97+
FixNamespaceComments: false
98+
ForEachMacros:
99+
- foreach
100+
- Q_FOREACH
101+
- BOOST_FOREACH
102+
IfMacros:
103+
- KJ_IF_MAYBE
104+
IncludeBlocks: Preserve
105+
IncludeCategories:
106+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
107+
Priority: 2
108+
SortPriority: 0
109+
CaseSensitive: false
110+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
111+
Priority: 3
112+
SortPriority: 0
113+
CaseSensitive: false
114+
- Regex: '.*'
115+
Priority: 1
116+
SortPriority: 0
117+
CaseSensitive: false
118+
IncludeIsMainRegex: '(Test)?$'
119+
IncludeIsMainSourceRegex: ''
120+
IndentAccessModifiers: false
121+
IndentCaseLabels: false
122+
IndentCaseBlocks: false
123+
IndentGotoLabels: true
124+
IndentPPDirectives: BeforeHash
125+
IndentExternBlock: AfterExternBlock
126+
IndentRequiresClause: true
127+
IndentWidth: 4
128+
IndentWrappedFunctionNames: false
129+
InsertBraces: false
130+
InsertTrailingCommas: None
131+
JavaScriptQuotes: Leave
132+
JavaScriptWrapImports: true
133+
KeepEmptyLinesAtTheStartOfBlocks: true
134+
LambdaBodyIndentation: Signature
135+
MacroBlockBegin: ''
136+
MacroBlockEnd: ''
137+
MaxEmptyLinesToKeep: 1
138+
NamespaceIndentation: None
139+
ObjCBinPackProtocolList: Auto
140+
ObjCBlockIndentWidth: 4
141+
ObjCBreakBeforeNestedBlockParam: true
142+
ObjCSpaceAfterProperty: true
143+
ObjCSpaceBeforeProtocolList: true
144+
PenaltyBreakAssignment: 2
145+
PenaltyBreakBeforeFirstCallParameter: 19
146+
PenaltyBreakComment: 300
147+
PenaltyBreakFirstLessLess: 120
148+
PenaltyBreakOpenParenthesis: 0
149+
PenaltyBreakString: 1000
150+
PenaltyBreakTemplateDeclaration: 10
151+
PenaltyExcessCharacter: 1000000
152+
PenaltyReturnTypeOnItsOwnLine: 60
153+
PenaltyIndentedWhitespace: 0
154+
PointerAlignment: Middle
155+
PPIndentWidth: -1
156+
ReferenceAlignment: Pointer
157+
ReflowComments: false
158+
RemoveBracesLLVM: false
159+
RequiresClausePosition: OwnLine
160+
SeparateDefinitionBlocks: Leave
161+
ShortNamespaceLines: 1
162+
SortIncludes: CaseSensitive
163+
SortJavaStaticImport: Before
164+
SortUsingDeclarations: true
165+
SpaceAfterCStyleCast: false
166+
SpaceAfterLogicalNot: false
167+
SpaceAfterTemplateKeyword: true
168+
SpaceBeforeAssignmentOperators: true
169+
SpaceBeforeCaseColon: false
170+
SpaceBeforeCpp11BracedList: true
171+
SpaceBeforeCtorInitializerColon: true
172+
SpaceBeforeInheritanceColon: true
173+
SpaceBeforeParens: ControlStatements
174+
SpaceBeforeParensOptions:
175+
AfterControlStatements: true
176+
AfterForeachMacros: true
177+
AfterFunctionDefinitionName: false
178+
AfterFunctionDeclarationName: false
179+
AfterIfMacros: true
180+
AfterOverloadedOperator: false
181+
AfterRequiresInClause: false
182+
AfterRequiresInExpression: false
183+
BeforeNonEmptyParentheses: false
184+
SpaceAroundPointerQualifiers: Default
185+
SpaceBeforeRangeBasedForLoopColon: true
186+
SpaceInEmptyBlock: true
187+
SpaceInEmptyParentheses: false
188+
SpacesBeforeTrailingComments: 1
189+
SpacesInAngles: Never
190+
SpacesInConditionalStatement: false
191+
SpacesInContainerLiterals: true
192+
SpacesInCStyleCastParentheses: false
193+
SpacesInLineCommentPrefix:
194+
Minimum: 1
195+
Maximum: -1
196+
SpacesInParentheses: false
197+
SpacesInSquareBrackets: false
198+
SpaceBeforeSquareBrackets: false
199+
BitFieldColonSpacing: Both
200+
Standard: Latest
201+
StatementAttributeLikeMacros:
202+
- Q_EMIT
203+
StatementMacros:
204+
- Q_UNUSED
205+
- QT_REQUIRE_VERSION
206+
TabWidth: 4
207+
UseCRLF: false
208+
UseTab: Always
209+
WhitespaceSensitiveMacros:
210+
- STRINGIZE
211+
- STRINGIFY
212+
- PP_STRINGIZE
213+
- BOOST_PP_STRINGIZE
214+
- NS_SWIFT_NAME
215+
- CF_SWIFT_NAME
216+
...
217+

commandLine/src/addons/ofAddon.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
#include "ofUtils.h"
9-
#include "ofFileUtils.h"
109
#include "ofAddon.h"
1110
#include "Utils.h"
1211
#include <list>
@@ -291,14 +290,28 @@ void ofAddon::exclude(vector<string> & variables, vector<string> exclusions){
291290
ofStringReplace(exclusion,".","\\.");
292291
ofStringReplace(exclusion,"%",".*");
293292
exclusion =".*"+ exclusion;
293+
// alert ("ofAddon::exclude " +exclusion, 31);
294294

295295
std::regex findVar(exclusion);
296296
std::smatch varMatch;
297+
// alert ("vars size " + ofToString(variables.size()));
298+
// for (auto & v : variables) {
299+
// alert ("\t" + v, 32);
300+
// }
297301
variables.erase(std::remove_if(variables.begin(), variables.end(), [&](const string & variable){
298302
auto forwardSlashedVariable = variable;
299303
ofStringReplace(forwardSlashedVariable, "\\", "/");
304+
// bool exclude = std::regex_search(forwardSlashedVariable, varMatch, findVar);
305+
// if (exclude) {
306+
// alert ("variable removed : " + variable, 31);
307+
// }
300308
return std::regex_search(forwardSlashedVariable, varMatch, findVar);
301309
}), variables.end());
310+
311+
// alert ("vars size " + ofToString(variables.size()));
312+
// for (auto & v : variables) {
313+
// alert ("\t" + v, 32);
314+
// }
302315
}
303316
}
304317

@@ -553,7 +566,7 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo
553566
}
554567

555568
bool ofAddon::fromFS(const fs::path & path, const string & platform){
556-
// alert("ofAddon::fromFS path : " + path.string());
569+
//alert("ofAddon::fromFS path : " + path.string(), 33);
557570

558571
if (!fs::exists(path)) {
559572
return false;
@@ -639,6 +652,12 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
639652
parseConfig();
640653

641654
exclude(includePaths, excludeIncludes);
655+
656+
// Dimitre. I've added this here to exclude some srcFiles from addons,
657+
// ofxAssimpModelLoader was adding some files from libs/assimp/include/assimp/port/AndroidJNI
658+
// even when the folder was excluded from includePaths
659+
exclude(srcFiles, excludeIncludes);
660+
642661
exclude(srcFiles, excludeSources);
643662
exclude(csrcFiles, excludeSources);
644663
exclude(cppsrcFiles, excludeSources);

commandLine/src/defines.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#define OFPROJECTGENERATOR_MAJOR_VERSION 0
22
#define OFPROJECTGENERATOR_MINOR_VERSION 12
33
#define OFPROJECTGENERATOR_PATCH_VERSION 1
4-

0 commit comments

Comments
 (0)