summaryrefslogtreecommitdiffhomepage
path: root/dev/DLL/RunSCM
diff options
context:
space:
mode:
Diffstat (limited to 'dev/DLL/RunSCM')
-rw-r--r--dev/DLL/RunSCM/Sources/LauncherMain.cxx25
-rw-r--r--dev/DLL/RunSCM/Sources/compile_flags.txt1
-rw-r--r--dev/DLL/RunSCM/build.json19
3 files changed, 45 insertions, 0 deletions
diff --git a/dev/DLL/RunSCM/Sources/LauncherMain.cxx b/dev/DLL/RunSCM/Sources/LauncherMain.cxx
new file mode 100644
index 00000000..51894df1
--- /dev/null
+++ b/dev/DLL/RunSCM/Sources/LauncherMain.cxx
@@ -0,0 +1,25 @@
+#include <SCI/sci_base.hxx>
+
+typedef int (*rpc_call_t)(IUnknown*);
+
+int WinMain(int argc, char* argv[])
+{
+ if (argc < 4)
+ return -1;
+
+ auto mainDll = LdrOpenDLL(argv[1], argv[2]);
+
+ IUnknown* interface = (IUnknown*)LdrGetDLLProc(argv[3], mainDll);
+ rpc_call_t dllRpc = (rpc_call_t)LdrGetDLLProc(argv[4], mainDll);
+
+ if (!dllRpc)
+ return -1;
+ if (!interface)
+ return -1;
+
+ auto ret = dllRpc(interface);
+
+ LdrCloseDLL(mainDll);
+
+ return ret;
+}
diff --git a/dev/DLL/RunSCM/Sources/compile_flags.txt b/dev/DLL/RunSCM/Sources/compile_flags.txt
new file mode 100644
index 00000000..53118879
--- /dev/null
+++ b/dev/DLL/RunSCM/Sources/compile_flags.txt
@@ -0,0 +1 @@
+-I../../SCI
diff --git a/dev/DLL/RunSCM/build.json b/dev/DLL/RunSCM/build.json
new file mode 100644
index 00000000..14aae6af
--- /dev/null
+++ b/dev/DLL/RunSCM/build.json
@@ -0,0 +1,19 @@
+{
+ "compiler_path": "x86_64-w64-mingw32-g++",
+ "compiler_std": "c++20",
+ "headers_path": ["../", "./", "../../"],
+ "sources_path": ["Sources/*.cxx"],
+ "output_name": "runscm.exe",
+ "compiler_flags": [
+ "-ffreestanding",
+ "-fno-rtti",
+ "-fno-exceptions",
+ " -Wl,--subsystem=17"
+ ],
+ "cpp_macros": [
+ "__SCM_AMD64__",
+ "cSCMVersion=0x0100",
+ "cSCMVersionHighest=0x0100",
+ "cSCMVersionLowest=0x0100"
+ ]
+}