Skip to content

Commit a71739a

Browse files
committed
replace relative path
1 parent e31679f commit a71739a

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

Firestore/Swift/Source/SwiftAPI/SwiftCppAPI.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
public class SwiftCallingCpp {
2222
public init(_ value: String) {
23-
CppInterfaceCalledBySwift.print(std.string(value))
23+
firebase.CppInterfaceCalledBySwift.print(std.string(value))
24+
firebase.CppInterfaceCalledBySwift.printTime(firebase.Timestamp(56, 32))
2425
}
2526
}

Firestore/core/swift/include/used_by_swift.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
#define FIREBASE_USED_BY_SWIFT_H
1919

2020
#include <string>
21+
#include "Firestore/core/include/firebase/firestore/timestamp.h"
2122

23+
namespace firebase {
2224
class CppInterfaceCalledBySwift {
2325
public:
2426
static void print(std::string content);
27+
static void printTime(Timestamp time);
2528
};
2629

30+
} // namespace firebase
2731
#endif // FIREBASE_USED_BY_SWIFT_H

Firestore/core/swift/src/used_by_swift.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include "../include/used_by_swift.h"
1818
#include <iostream>
1919

20-
void CppInterfaceCalledBySwift::print(std::string content) {
20+
void firebase::CppInterfaceCalledBySwift::print(std::string content) {
2121
std::cout << "C++ function runs with value: " << content << std::endl;
2222
}
23+
24+
void firebase::CppInterfaceCalledBySwift::printTime(firebase::Timestamp time) {
25+
std::cout << "C++ function runs with value: " << time.ToString() << std::endl;
26+
}

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,7 @@ func firebaseFirestoreCppTarget() -> Target {
14111411
path: "Firestore/core/swift",
14121412
publicHeadersPath: "include", // Path to the public headers
14131413
cxxSettings: [
1414+
.headerSearchPath("../../../"),
14141415
.headerSearchPath("include"), // Ensure the header search path is correct
14151416
]
14161417
)

0 commit comments

Comments
 (0)