aboutsummaryrefslogtreecommitdiff
path: root/mwe/dynlink/lib
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-09-04 13:09:34 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-09-04 13:09:34 +0200
commitbbd66503d81b6ee8509d0c0604128d7a3acca81a (patch)
tree97d6b482579cb8a6c3ff35d60aa6fc05b3be3440 /mwe/dynlink/lib
parent7b910e400e75c8e99ce14238a5a1f840ba4d840e (diff)
add dynamic linking test (tested on linux)
Diffstat (limited to 'mwe/dynlink/lib')
-rw-r--r--mwe/dynlink/lib/CMakeLists.txt10
-rw-r--r--mwe/dynlink/lib/lib.c6
-rw-r--r--mwe/dynlink/lib/lib.h4
-rw-r--r--mwe/dynlink/lib/makefile1
4 files changed, 21 insertions, 0 deletions
diff --git a/mwe/dynlink/lib/CMakeLists.txt b/mwe/dynlink/lib/CMakeLists.txt
new file mode 100644
index 0000000..2d15353
--- /dev/null
+++ b/mwe/dynlink/lib/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.28)
+
+set(CMAKE_C_STANDARD 11)
+set(CMAKE_CXX_STANDARD 20)
+
+project(lib C CXX)
+
+add_library(test SHARED lib.c)
+target_include_directories(test SYSTEM INTERFACE .)
+
diff --git a/mwe/dynlink/lib/lib.c b/mwe/dynlink/lib/lib.c
new file mode 100644
index 0000000..930e403
--- /dev/null
+++ b/mwe/dynlink/lib/lib.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void library_function() {
+ printf("%s\n", __PRETTY_FUNCTION__);
+}
+
diff --git a/mwe/dynlink/lib/lib.h b/mwe/dynlink/lib/lib.h
new file mode 100644
index 0000000..068f07d
--- /dev/null
+++ b/mwe/dynlink/lib/lib.h
@@ -0,0 +1,4 @@
+#pragma once
+
+void library_function();
+
diff --git a/mwe/dynlink/lib/makefile b/mwe/dynlink/lib/makefile
new file mode 100644
index 0000000..eec7c61
--- /dev/null
+++ b/mwe/dynlink/lib/makefile
@@ -0,0 +1 @@
+include ../../../lazy.mk