mirror of
https://github.com/GayPizzaSpecifications/cxx-swift-interop.git
synced 2026-11-04 14:12:20 +00:00
initial commit
This commit is contained in:
12 files changed
+405
No files matched your search
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(SwiftFrontend)
|
||||
add_subdirectory(CppBackend)
|
||||
@@ -0,0 +1,4 @@
|
||||
add_library(CppBackend STATIC backend.h backend.cpp)
|
||||
|
||||
set_target_properties(CppBackend PROPERTIES Swift_MODULE_NAME "CppBackend")
|
||||
target_compile_options(CppBackend PUBLIC "$<$<COMPILE_LANGUAGE:Swift>:-cxx-interoperability-mode=default>")
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "backend.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void backend_init() {
|
||||
std::cout << "Hello World" << std::endl;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void backend_init();
|
||||
@@ -0,0 +1,3 @@
|
||||
module CppBackend {
|
||||
header "backend.h"
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
add_executable(SwiftFrontend main.swift)
|
||||
target_link_libraries(SwiftFrontend PRIVATE CppBackend)
|
||||
@@ -0,0 +1,4 @@
|
||||
import CppBackend
|
||||
|
||||
backend_init()
|
||||
print("Hello World")
|
||||
Reference in new issue
Block a user