Skip to content

Issues with arc flags #608

@eduardfrigola

Description

@eduardfrigola

Platform: macos
OS Version Sonoma 14.7.1
Xcode Version: 15.4

Latest nighty (of_20250303)

Trying to compile ofxSyphon/of_head example results in flags errors.

Image

In Build Settings, -fno-obj-arc is apearing multiple times (and i suspect active for all files in the project)

Image

I suspect this was introduced in 8294756 with this relevant section.

void xcodeProject::addCompileFlagsForMMFile(const fs::path & srcFile) {
std::ifstream file(srcFile);
if (!file.is_open()) return;
bool requiresNoARC = false;
// Named regex for detecting ARC-related function calls in Objective-C++
const std::regex arcFunctionRegex(R"(\b(alloc|dealloc|retain|release|autorelease)\b)");
for (std::string line; std::getline(file, line); ) {
if (std::regex_search(line, arcFunctionRegex)) {
requiresNoARC = true;
break;
}
}
// Tag file as Objective-C++ in Xcode build settings
for (auto & c : buildConfigs) {
addCommand("Add :objects:" + c + ":buildSettings:OTHER_CPLUSPLUSFLAGS: string -x objective-c++");
if (requiresNoARC) {
addCommand("Add :objects:" + c + ":buildSettings:OTHER_CPLUSPLUSFLAGS: string -fno-objc-arc");
}
}
}

I currently cannot debug deeper into this. I'll try to build projectGenerator to inspect it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions