[ios] Allowed to use C++ editor methods directly from Swift

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-07-03 20:41:05 +02:00
committed by Konstantin Pastbin
parent 13ba20aa25
commit ef9618b3d6
6 changed files with 24 additions and 6 deletions

6
editor/module.modulemap Normal file
View File

@@ -0,0 +1,6 @@
module OSMEditor {
header "osm_auth.hpp"
header "osm_editor.hpp"
header "server_api.hpp"
requires cplusplus
}

View File

@@ -1,6 +1,7 @@
#import "MWMAlertViewController.h"
#import "MWMOsmAuthAlert.h"
#include <string>
#include "editor/osm_auth.hpp"
static NSString * const kMap2OsmLoginSegue = @"Map2OsmLogin";

View File

@@ -1,3 +1,4 @@
#include <string>
#include "editor/osm_auth.hpp"
namespace osm_auth_ios

View File

@@ -2,6 +2,8 @@
#import <CoreApi/AppInfo.h>
#import "MWMAuthorizationCommon.h"
#include <string>
#include <map>
#include "editor/osm_editor.hpp"
@implementation MWMEditorHelper

View File

@@ -5235,6 +5235,8 @@
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = app.comaps.debug;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_INCLUDE_PATHS = "$(OMIM_ROOT)/editor";
SWIFT_OBJC_INTEROP_MODE = objcxx;
};
name = Debug;
};
@@ -5268,6 +5270,8 @@
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = app.comaps;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_INCLUDE_PATHS = "$(OMIM_ROOT)/editor";
SWIFT_OBJC_INTEROP_MODE = objcxx;
};
name = Release;
};
@@ -5391,12 +5395,13 @@
"$(OTHER_CFLAGS)",
"-fcxx-modules",
);
OTHER_SWIFT_FLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited) -cxx-interoperability-mode=default";
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_IDENTIFIER}";
PRODUCT_NAME = "CoMaps (Debug)";
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_INCLUDE_PATHS = "$(OMIM_ROOT)/editor";
SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h";
SWIFT_OBJC_INTERFACE_HEADER_NAME = SwiftBridge.h;
SWIFT_PRECOMPILE_BRIDGING_HEADER = NO;
@@ -5431,12 +5436,13 @@
"$(OTHER_CFLAGS)",
"-fcxx-modules",
);
OTHER_SWIFT_FLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited) -cxx-interoperability-mode=default";
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_IDENTIFIER}";
PRODUCT_NAME = CoMaps;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_INCLUDE_PATHS = "$(OMIM_ROOT)/editor";
SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h";
SWIFT_OBJC_INTERFACE_HEADER_NAME = SwiftBridge.h;
SWIFT_PRECOMPILE_BRIDGING_HEADER = NO;

View File

@@ -74,6 +74,7 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
270C9C212E16AABF00ABA688 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = ../../editor/module.modulemap; sourceTree = SOURCE_ROOT; };
340C20DC1C3E4DFD00111D22 /* osm_auth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = osm_auth.cpp; sourceTree = "<group>"; };
340C20DD1C3E4DFD00111D22 /* osm_auth.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = osm_auth.hpp; sourceTree = "<group>"; };
340DC8271C4E71E500EAA2CC /* changeset_wrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = changeset_wrapper.cpp; sourceTree = "<group>"; };
@@ -196,6 +197,7 @@
isa = PBXGroup;
children = (
3496AC041DC204B700C5DDBA /* editor.config */,
270C9C212E16AABF00ABA688 /* module.modulemap */,
34F5586E1DBF49B200A4FC11 /* common-debug.xcconfig */,
34F5586F1DBF49B200A4FC11 /* common-release.xcconfig */,
341138731C15AE02002E3B3E /* editor */,
@@ -546,12 +548,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
PRODUCT_BUNDLE_IDENTIFIER = app.comaps.editor_tests;
PRODUCT_NAME = "$(TARGET_NAME)";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(OMIM_ROOT)/3party/pugixml/pugixml/src",
);
PRODUCT_BUNDLE_IDENTIFIER = app.comaps.editor_tests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
@@ -559,12 +561,12 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
PRODUCT_BUNDLE_IDENTIFIER = app.comaps.editor_tests;
PRODUCT_NAME = "$(TARGET_NAME)";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(OMIM_ROOT)/3party/pugixml/pugixml/src",
);
PRODUCT_BUNDLE_IDENTIFIER = app.comaps.editor_tests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};