aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devtools/create_project/xcode.cpp13
-rw-r--r--gui/module.mk11
2 files changed, 13 insertions, 11 deletions
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 7e4a70c157..78c3cf3dff 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -389,6 +389,14 @@ void XcodeProvider::writeFileListToProject(const FileNode &dir, std::ofstream &p
// for folders, we shouldn't add folders as file references, obviously.
if (node->children.empty()) {
group->addChildFile(node->name);
+
+ // HACK: Also add browser_osx.mm, since browser.cpp is added for
+ // iOS and browser_osx.mm for macOS, and create_project cannot
+ // deal with two competing exclusive ifdefs in module.mk going
+ // into one project
+ if (filePrefix.find("/gui/") == filePrefix.size() - 5 && node->name == "browser.cpp") {
+ group->addChildFile("browser_osx.mm");
+ }
}
// Process child nodes
if (!node->children.empty())
@@ -1066,6 +1074,11 @@ void XcodeProvider::setupAdditionalSources(std::string targetName, Property &fil
if (targetIsIOS(targetName)) {
const std::string absoluteCatalogPath = _projectRoot + "/dists/ios7/Images.xcassets";
ADD_SETTING_ORDER_NOVALUE(files, getHash(absoluteCatalogPath), "Image Asset Catalog", order++);
+ } else {
+ // HACK: browser_osx.mm needs to be added
+ const std::string browserPath = "gui/browser_osx.mm";
+ const std::string comment = "browser_osx.mm in Sources";
+ ADD_SETTING_ORDER_NOVALUE(files, getHash(browserPath), comment, order++);
}
}
diff --git a/gui/module.mk b/gui/module.mk
index 5b32689a82..171b3aa0e9 100644
--- a/gui/module.mk
+++ b/gui/module.mk
@@ -37,14 +37,6 @@ MODULE_OBJS := \
widgets/scrollcontainer.o \
widgets/tab.o
-# HACK: create_project's XCode generator relies on the following ifdef
-# structure to pick up the right browser implementations for iOS and Mac OS X.
-# Please keep it like this or XCode project generation will be broken.
-# FIXME: This only works because of a bug in how we handle ifdef statements in
-# create_project's module.mk parser. create_project will think that both
-# browser.o and browser_osx.o is built when both IPHONE and MACOSX is set.
-# When we do proper ifdef handling, only browser.o will be picked up, breaking
-# XCode generation.
ifdef IPHONE
MODULE_OBJS += \
browser.o
@@ -52,9 +44,6 @@ else
ifdef MACOSX
MODULE_OBJS += \
browser_osx.o
-else
-MODULE_OBJS += \
- browser.o
endif
endif