From 00333c785ab02c7010c2e07981d5d792c218c9ee Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 30 Mar 2026 11:32:26 +0200 Subject: remove examples "dynamic" & "static" To be specific the "dynamic" example is the new "simple". I don't need 3 basic example projects, one is enough. --- examples/simple/CMakeLists.txt | 6 +++++- examples/simple/baz.cpp | 7 +++++++ examples/simple/baz.hpp | 9 +++++++++ examples/simple/foo.cpp | 3 +++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 examples/simple/baz.cpp create mode 100644 examples/simple/baz.hpp (limited to 'examples/simple') diff --git a/examples/simple/CMakeLists.txt b/examples/simple/CMakeLists.txt index f2ba4d4..50a588b 100644 --- a/examples/simple/CMakeLists.txt +++ b/examples/simple/CMakeLists.txt @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.15) project(example_simple) +add_library(baz SHARED baz.cpp) +target_include_directories(baz PUBLIC .) + add_executable(foo foo.cpp) +target_link_libraries(foo PRIVATE baz) -install(TARGETS foo RUNTIME DESTINATION bin) +install(TARGETS foo baz RUNTIME DESTINATION bin LIBRARY DESTINATION lib) diff --git a/examples/simple/baz.cpp b/examples/simple/baz.cpp new file mode 100644 index 0000000..d108ae3 --- /dev/null +++ b/examples/simple/baz.cpp @@ -0,0 +1,7 @@ +#include "baz.hpp" + +#include + +void baz() { + std::cout << "baz\n"; +} diff --git a/examples/simple/baz.hpp b/examples/simple/baz.hpp new file mode 100644 index 0000000..2fc9b2a --- /dev/null +++ b/examples/simple/baz.hpp @@ -0,0 +1,9 @@ +#pragma once + +#ifdef _MSC_VER +#define DLLEXPORT __declspec(dllexport) +#else +#define DLLEXPORT +#endif + +DLLEXPORT void baz(); diff --git a/examples/simple/foo.cpp b/examples/simple/foo.cpp index b9d3132..7e928e1 100644 --- a/examples/simple/foo.cpp +++ b/examples/simple/foo.cpp @@ -1,6 +1,9 @@ +#include + #include int main() { std::cout << "foo\n"; + baz(); return 0; } -- cgit v1.3