diff --git a/Package.resolved b/Package.resolved index 96962bb2..3f04d995 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "18d78a641a729a881369f12bb5a8ed756f270457dc57b6490548b38073085243", + "originHash" : "18d337464a9504496064f43500ecb94e8a9dde167a757ab1aeb3948247e257c0", "pins" : [ { "identity" : "darwinprivateframeworks", diff --git a/Package.swift b/Package.swift index e3913e09..b565cbf1 100644 --- a/Package.swift +++ b/Package.swift @@ -178,8 +178,7 @@ let openGraphSPITestTarget = Target.testTarget( cSettings: sharedCSettings + [ .headerSearchPath("../../Sources/OpenGraph_SPI"), ], - swiftSettings: sharedSwiftSettings, - linkerSettings: [.linkedFramework("XCTest")] + swiftSettings: sharedSwiftSettings + [.interoperabilityMode(.Cxx)] ) let openGraphShimsTestTarget = Target.testTarget( name: "OpenGraphShimsTests", diff --git a/Sources/OpenGraph_SPI/Data/ptr.hpp b/Sources/OpenGraph_SPI/Data/ptr.hpp index b1b18322..a96bd559 100644 --- a/Sources/OpenGraph_SPI/Data/ptr.hpp +++ b/Sources/OpenGraph_SPI/Data/ptr.hpp @@ -9,7 +9,7 @@ #define ptr_hpp #include "OGBase.h" -#include "table.hpp" +#include "OpenGraphCxx/table.hpp" #include #include "page_const.hpp" diff --git a/Sources/OpenGraph_SPI/Data/table.cpp b/Sources/OpenGraph_SPI/Data/table.cpp index 6a2877ac..955fbee1 100644 --- a/Sources/OpenGraph_SPI/Data/table.cpp +++ b/Sources/OpenGraph_SPI/Data/table.cpp @@ -6,7 +6,7 @@ // Status: WIP // Modified from https://github.com/jcmosc/Compute/blob/0a6b21a4cdeb9bbdd95e7e914c4e18bed37a2456/Sources/ComputeCxx/Data/Table.cpp [MIT License] -#include "table.hpp" +#include #include "page.hpp" #include "page_const.hpp" #include "zone.hpp" diff --git a/Sources/OpenGraph_SPI/Data/zone.cpp b/Sources/OpenGraph_SPI/Data/zone.cpp index 490f487d..a5a878e6 100644 --- a/Sources/OpenGraph_SPI/Data/zone.cpp +++ b/Sources/OpenGraph_SPI/Data/zone.cpp @@ -3,7 +3,7 @@ // OpenGraph_SPI #include "zone.hpp" -#include "table.hpp" +#include #include "page.hpp" #include "../Util/assert.hpp" #if OG_TARGET_OS_DARWIN diff --git a/Sources/OpenGraph_SPI/include/OpenGraph.h b/Sources/OpenGraph_SPI/include/OpenGraph-umbrella.h similarity index 100% rename from Sources/OpenGraph_SPI/include/OpenGraph.h rename to Sources/OpenGraph_SPI/include/OpenGraph-umbrella.h diff --git a/Sources/OpenGraph_SPI/Data/table.hpp b/Sources/OpenGraph_SPI/include/OpenGraphCxx/table.hpp similarity index 100% rename from Sources/OpenGraph_SPI/Data/table.hpp rename to Sources/OpenGraph_SPI/include/OpenGraphCxx/table.hpp diff --git a/Sources/OpenGraph_SPI/include/module.modulemap b/Sources/OpenGraph_SPI/include/module.modulemap new file mode 100644 index 00000000..c97b982d --- /dev/null +++ b/Sources/OpenGraph_SPI/include/module.modulemap @@ -0,0 +1,11 @@ +module OpenGraph_SPI { + header "OpenGraph-umbrella.h" + export * +} + +// TODO: Change to module OpenGraphCxx and OpenGraphCxx.Internal +module OpenGraph_SPI.Cxx { + requires cplusplus + umbrella "OpenGraphCxx" + export * +} diff --git a/Tests/OpenGraph_SPITests/OpenGraph_SPITests.swift b/Tests/OpenGraph_SPITests/OpenGraph_SPITests.swift new file mode 100644 index 00000000..218cc8f3 --- /dev/null +++ b/Tests/OpenGraph_SPITests/OpenGraph_SPITests.swift @@ -0,0 +1,15 @@ +// +// OpenGraph_SPITests.swift +// OpenGraph + +import OpenGraph_SPI.Cxx +import Testing + +struct OpenGraph_SPITests { + #if canImport(Darwin) // table() is not implemented on Linux yet. + @Test + func table() { + OG.data.table.ensure_shared() + } + #endif +} diff --git a/Tests/OpenGraph_SPITests/table_test_case.mm b/Tests/OpenGraph_SPITests/table_test_case.mm deleted file mode 100644 index aa6fd11c..00000000 --- a/Tests/OpenGraph_SPITests/table_test_case.mm +++ /dev/null @@ -1,24 +0,0 @@ -// -// table_test_case.mm -// OpenGraph_SPITests - -#include "OGBase.h" - -#if OG_TARGET_OS_DARWIN -#include -#include "Data/table.hpp" - -using namespace OG; - -@interface TableTestCase : XCTestCase -@end - -@implementation TableTestCase - -- (void)setUp { - [super setUp]; - data::table::ensure_shared(); -} - -@end -#endif