From 42c03da5c8d5c10f19067726a6dbac218d3e6020 Mon Sep 17 00:00:00 2001 From: Tamino Bauknecht Date: Mon, 1 Apr 2024 14:46:25 +0200 Subject: [PATCH 1/5] include: Move include/ to include/ppplugin/ This is necessary to avoid users of the library having to add include/ppplugin/ to the include path which may lead to confusing bugs with common header names. An alternative would be using a symlink include/ppplugin/ pointing to include/, but a circular symlink may cause issues in some obscure build system. --- include/{ => ppplugin}/c/plugin.h | 0 include/{ => ppplugin}/cpp/object_plugin.h | 0 include/{ => ppplugin}/cpp/plugin.h | 0 include/{ => ppplugin}/detail/boost_dll_loader.h | 0 include/{ => ppplugin}/detail/compatibility_utils.h | 0 include/{ => ppplugin}/detail/compiler_info.h | 0 include/{ => ppplugin}/detail/function_details.h | 0 include/{ => ppplugin}/detail/scope_guard.h | 0 include/{ => ppplugin}/detail/template_helpers.h | 0 include/{ => ppplugin}/errors.h | 0 include/{ => ppplugin}/expected.h | 0 include/{ => ppplugin}/lua/lua_helpers.h | 0 include/{ => ppplugin}/lua/lua_script.h | 0 include/{ => ppplugin}/lua/lua_state.h | 0 include/{ => ppplugin}/lua/plugin.h | 0 include/{ => ppplugin}/noop_plugin.h | 0 include/{ => ppplugin}/plugin.h | 0 include/{ => ppplugin}/plugin_manager.h | 0 include/{ => ppplugin}/python/plugin.h | 0 include/{ => ppplugin}/python/python_exception.h | 0 include/{ => ppplugin}/python/python_forward_defs.h | 0 include/{ => ppplugin}/python/python_guard.h | 0 include/{ => ppplugin}/python/python_interpreter.h | 0 include/{ => ppplugin}/python/python_object.h | 0 include/{ => ppplugin}/python/python_tuple.h | 0 25 files changed, 0 insertions(+), 0 deletions(-) rename include/{ => ppplugin}/c/plugin.h (100%) rename include/{ => ppplugin}/cpp/object_plugin.h (100%) rename include/{ => ppplugin}/cpp/plugin.h (100%) rename include/{ => ppplugin}/detail/boost_dll_loader.h (100%) rename include/{ => ppplugin}/detail/compatibility_utils.h (100%) rename include/{ => ppplugin}/detail/compiler_info.h (100%) rename include/{ => ppplugin}/detail/function_details.h (100%) rename include/{ => ppplugin}/detail/scope_guard.h (100%) rename include/{ => ppplugin}/detail/template_helpers.h (100%) rename include/{ => ppplugin}/errors.h (100%) rename include/{ => ppplugin}/expected.h (100%) rename include/{ => ppplugin}/lua/lua_helpers.h (100%) rename include/{ => ppplugin}/lua/lua_script.h (100%) rename include/{ => ppplugin}/lua/lua_state.h (100%) rename include/{ => ppplugin}/lua/plugin.h (100%) rename include/{ => ppplugin}/noop_plugin.h (100%) rename include/{ => ppplugin}/plugin.h (100%) rename include/{ => ppplugin}/plugin_manager.h (100%) rename include/{ => ppplugin}/python/plugin.h (100%) rename include/{ => ppplugin}/python/python_exception.h (100%) rename include/{ => ppplugin}/python/python_forward_defs.h (100%) rename include/{ => ppplugin}/python/python_guard.h (100%) rename include/{ => ppplugin}/python/python_interpreter.h (100%) rename include/{ => ppplugin}/python/python_object.h (100%) rename include/{ => ppplugin}/python/python_tuple.h (100%) diff --git a/include/c/plugin.h b/include/ppplugin/c/plugin.h similarity index 100% rename from include/c/plugin.h rename to include/ppplugin/c/plugin.h diff --git a/include/cpp/object_plugin.h b/include/ppplugin/cpp/object_plugin.h similarity index 100% rename from include/cpp/object_plugin.h rename to include/ppplugin/cpp/object_plugin.h diff --git a/include/cpp/plugin.h b/include/ppplugin/cpp/plugin.h similarity index 100% rename from include/cpp/plugin.h rename to include/ppplugin/cpp/plugin.h diff --git a/include/detail/boost_dll_loader.h b/include/ppplugin/detail/boost_dll_loader.h similarity index 100% rename from include/detail/boost_dll_loader.h rename to include/ppplugin/detail/boost_dll_loader.h diff --git a/include/detail/compatibility_utils.h b/include/ppplugin/detail/compatibility_utils.h similarity index 100% rename from include/detail/compatibility_utils.h rename to include/ppplugin/detail/compatibility_utils.h diff --git a/include/detail/compiler_info.h b/include/ppplugin/detail/compiler_info.h similarity index 100% rename from include/detail/compiler_info.h rename to include/ppplugin/detail/compiler_info.h diff --git a/include/detail/function_details.h b/include/ppplugin/detail/function_details.h similarity index 100% rename from include/detail/function_details.h rename to include/ppplugin/detail/function_details.h diff --git a/include/detail/scope_guard.h b/include/ppplugin/detail/scope_guard.h similarity index 100% rename from include/detail/scope_guard.h rename to include/ppplugin/detail/scope_guard.h diff --git a/include/detail/template_helpers.h b/include/ppplugin/detail/template_helpers.h similarity index 100% rename from include/detail/template_helpers.h rename to include/ppplugin/detail/template_helpers.h diff --git a/include/errors.h b/include/ppplugin/errors.h similarity index 100% rename from include/errors.h rename to include/ppplugin/errors.h diff --git a/include/expected.h b/include/ppplugin/expected.h similarity index 100% rename from include/expected.h rename to include/ppplugin/expected.h diff --git a/include/lua/lua_helpers.h b/include/ppplugin/lua/lua_helpers.h similarity index 100% rename from include/lua/lua_helpers.h rename to include/ppplugin/lua/lua_helpers.h diff --git a/include/lua/lua_script.h b/include/ppplugin/lua/lua_script.h similarity index 100% rename from include/lua/lua_script.h rename to include/ppplugin/lua/lua_script.h diff --git a/include/lua/lua_state.h b/include/ppplugin/lua/lua_state.h similarity index 100% rename from include/lua/lua_state.h rename to include/ppplugin/lua/lua_state.h diff --git a/include/lua/plugin.h b/include/ppplugin/lua/plugin.h similarity index 100% rename from include/lua/plugin.h rename to include/ppplugin/lua/plugin.h diff --git a/include/noop_plugin.h b/include/ppplugin/noop_plugin.h similarity index 100% rename from include/noop_plugin.h rename to include/ppplugin/noop_plugin.h diff --git a/include/plugin.h b/include/ppplugin/plugin.h similarity index 100% rename from include/plugin.h rename to include/ppplugin/plugin.h diff --git a/include/plugin_manager.h b/include/ppplugin/plugin_manager.h similarity index 100% rename from include/plugin_manager.h rename to include/ppplugin/plugin_manager.h diff --git a/include/python/plugin.h b/include/ppplugin/python/plugin.h similarity index 100% rename from include/python/plugin.h rename to include/ppplugin/python/plugin.h diff --git a/include/python/python_exception.h b/include/ppplugin/python/python_exception.h similarity index 100% rename from include/python/python_exception.h rename to include/ppplugin/python/python_exception.h diff --git a/include/python/python_forward_defs.h b/include/ppplugin/python/python_forward_defs.h similarity index 100% rename from include/python/python_forward_defs.h rename to include/ppplugin/python/python_forward_defs.h diff --git a/include/python/python_guard.h b/include/ppplugin/python/python_guard.h similarity index 100% rename from include/python/python_guard.h rename to include/ppplugin/python/python_guard.h diff --git a/include/python/python_interpreter.h b/include/ppplugin/python/python_interpreter.h similarity index 100% rename from include/python/python_interpreter.h rename to include/ppplugin/python/python_interpreter.h diff --git a/include/python/python_object.h b/include/ppplugin/python/python_object.h similarity index 100% rename from include/python/python_object.h rename to include/ppplugin/python/python_object.h diff --git a/include/python/python_tuple.h b/include/ppplugin/python/python_tuple.h similarity index 100% rename from include/python/python_tuple.h rename to include/ppplugin/python/python_tuple.h From 9b700908b8cf5adaee779608cd35b26c49f5ef07 Mon Sep 17 00:00:00 2001 From: Tamino Bauknecht Date: Tue, 26 Nov 2024 22:34:41 +0100 Subject: [PATCH 2/5] include|src: Adapt ppplugin include paths --- include/ppplugin/c/plugin.h | 4 ++-- include/ppplugin/cpp/plugin.h | 4 ++-- include/ppplugin/detail/boost_dll_loader.h | 2 +- include/ppplugin/detail/function_details.h | 2 +- include/ppplugin/errors.h | 4 ++-- include/ppplugin/lua/lua_script.h | 4 ++-- include/ppplugin/lua/lua_state.h | 6 +++--- include/ppplugin/lua/plugin.h | 4 ++-- include/ppplugin/noop_plugin.h | 2 +- include/ppplugin/plugin.h | 16 ++++++++-------- include/ppplugin/plugin_manager.h | 16 ++++++++-------- include/ppplugin/python/plugin.h | 8 ++++---- include/ppplugin/python/python_interpreter.h | 4 ++-- include/ppplugin/python/python_tuple.h | 1 - src/boost_dll_loader.cpp | 2 +- src/lua_script.cpp | 10 +++++----- src/lua_state.cpp | 2 +- src/python_exception.cpp | 6 +++--- src/python_guard.cpp | 4 ++-- src/python_interpreter.cpp | 12 ++++++------ src/python_object.cpp | 2 +- src/python_plugin.cpp | 6 +++--- src/python_tuple.cpp | 4 ++-- 23 files changed, 62 insertions(+), 63 deletions(-) diff --git a/include/ppplugin/c/plugin.h b/include/ppplugin/c/plugin.h index dbf83bb..faf1c07 100644 --- a/include/ppplugin/c/plugin.h +++ b/include/ppplugin/c/plugin.h @@ -1,8 +1,8 @@ #ifndef PPPLUGIN_C_PLUGIN_H #define PPPLUGIN_C_PLUGIN_H -#include "detail/boost_dll_loader.h" -#include "errors.h" +#include "ppplugin/detail/boost_dll_loader.h" +#include "ppplugin/errors.h" namespace ppplugin { class CPlugin { diff --git a/include/ppplugin/cpp/plugin.h b/include/ppplugin/cpp/plugin.h index 3056b3a..e06eddd 100644 --- a/include/ppplugin/cpp/plugin.h +++ b/include/ppplugin/cpp/plugin.h @@ -1,8 +1,8 @@ #ifndef PPPLUGIN_CPP_PLUGIN_H #define PPPLUGIN_CPP_PLUGIN_H -#include "detail/boost_dll_loader.h" -#include "errors.h" +#include "ppplugin/detail/boost_dll_loader.h" +#include "ppplugin/errors.h" #include diff --git a/include/ppplugin/detail/boost_dll_loader.h b/include/ppplugin/detail/boost_dll_loader.h index ec5c0b6..7bb7b42 100644 --- a/include/ppplugin/detail/boost_dll_loader.h +++ b/include/ppplugin/detail/boost_dll_loader.h @@ -1,7 +1,7 @@ #ifndef PPPLUGIN_DETAIL_BOOST_DLL_LOADER_H #define PPPLUGIN_DETAIL_BOOST_DLL_LOADER_H -#include "errors.h" +#include "ppplugin/errors.h" #include diff --git a/include/ppplugin/detail/function_details.h b/include/ppplugin/detail/function_details.h index 2aa9336..34d021a 100644 --- a/include/ppplugin/detail/function_details.h +++ b/include/ppplugin/detail/function_details.h @@ -1,7 +1,7 @@ #ifndef PPPLUGIN_DETAIL_FUNCTION_DETAILS_H #define PPPLUGIN_DETAIL_FUNCTION_DETAILS_H -#include "detail/template_helpers.h" +#include "ppplugin/detail/template_helpers.h" #include diff --git a/include/ppplugin/errors.h b/include/ppplugin/errors.h index 01d69da..0aa6749 100644 --- a/include/ppplugin/errors.h +++ b/include/ppplugin/errors.h @@ -1,8 +1,8 @@ #ifndef PPPLUGIN_ERRORS_H #define PPPLUGIN_ERRORS_H -#include "detail/compatibility_utils.h" -#include "expected.h" +#include "ppplugin/detail/compatibility_utils.h" +#include "ppplugin/expected.h" #include #ifndef PPPLUGIN_CPP17_COMPATIBILITY diff --git a/include/ppplugin/lua/lua_script.h b/include/ppplugin/lua/lua_script.h index 270634d..5a456b1 100644 --- a/include/ppplugin/lua/lua_script.h +++ b/include/ppplugin/lua/lua_script.h @@ -1,9 +1,9 @@ #ifndef PPPLUGIN_LUA_SCRIPT_H #define PPPLUGIN_LUA_SCRIPT_H -#include "errors.h" -#include "expected.h" #include "lua_state.h" +#include "ppplugin/errors.h" +#include "ppplugin/expected.h" #include #include diff --git a/include/ppplugin/lua/lua_state.h b/include/ppplugin/lua/lua_state.h index 0ffee8c..599e074 100644 --- a/include/ppplugin/lua/lua_state.h +++ b/include/ppplugin/lua/lua_state.h @@ -1,10 +1,10 @@ #ifndef PPPLUGIN_LUA_STATE_H #define PPPLUGIN_LUA_STATE_H -#include "detail/compatibility_utils.h" -#include "detail/function_details.h" -#include "errors.h" #include "lua_helpers.h" +#include "ppplugin/detail/compatibility_utils.h" +#include "ppplugin/detail/function_details.h" +#include "ppplugin/errors.h" #include #include diff --git a/include/ppplugin/lua/plugin.h b/include/ppplugin/lua/plugin.h index 2284869..23bacba 100644 --- a/include/ppplugin/lua/plugin.h +++ b/include/ppplugin/lua/plugin.h @@ -1,8 +1,8 @@ #ifndef PPPLUGIN_LUA_PLUGIN_H #define PPPLUGIN_LUA_PLUGIN_H -#include "errors.h" -#include "lua/lua_script.h" +#include "lua_script.h" +#include "ppplugin/errors.h" #include diff --git a/include/ppplugin/noop_plugin.h b/include/ppplugin/noop_plugin.h index 6bb3ee6..5a41d5c 100644 --- a/include/ppplugin/noop_plugin.h +++ b/include/ppplugin/noop_plugin.h @@ -1,7 +1,7 @@ #ifndef PPPLUGIN_NOOP_PLUGIN_H #define PPPLUGIN_NOOP_PLUGIN_H -#include "errors.h" +#include "ppplugin/errors.h" #include diff --git a/include/ppplugin/plugin.h b/include/ppplugin/plugin.h index f7698f0..05a6950 100644 --- a/include/ppplugin/plugin.h +++ b/include/ppplugin/plugin.h @@ -1,14 +1,14 @@ #ifndef PPPLUGIN_PLUGIN_H #define PPPLUGIN_PLUGIN_H -#include "c/plugin.h" -#include "cpp/plugin.h" -#include "errors.h" -#include "lua/plugin.h" -#include "noop_plugin.h" -#include "python/plugin.h" - -#include "detail/template_helpers.h" +#include "ppplugin/c/plugin.h" +#include "ppplugin/cpp/plugin.h" +#include "ppplugin/errors.h" +#include "ppplugin/lua/plugin.h" +#include "ppplugin/noop_plugin.h" +#include "ppplugin/python/plugin.h" + +#include "ppplugin/detail/template_helpers.h" #include diff --git a/include/ppplugin/plugin_manager.h b/include/ppplugin/plugin_manager.h index 2e6a4c7..9fb84dc 100644 --- a/include/ppplugin/plugin_manager.h +++ b/include/ppplugin/plugin_manager.h @@ -1,14 +1,14 @@ #ifndef PPPLUGIN_PLUGIN_MANAGER_H #define PPPLUGIN_PLUGIN_MANAGER_H -#include "c/plugin.h" -#include "cpp/plugin.h" -#include "detail/template_helpers.h" -#include "errors.h" -#include "expected.h" -#include "lua/plugin.h" -#include "plugin.h" -#include "python/plugin.h" +#include "ppplugin/c/plugin.h" +#include "ppplugin/cpp/plugin.h" +#include "ppplugin/detail/template_helpers.h" +#include "ppplugin/errors.h" +#include "ppplugin/expected.h" +#include "ppplugin/lua/plugin.h" +#include "ppplugin/plugin.h" +#include "ppplugin/python/plugin.h" #include diff --git a/include/ppplugin/python/plugin.h b/include/ppplugin/python/plugin.h index a6225c8..bf9fb16 100644 --- a/include/ppplugin/python/plugin.h +++ b/include/ppplugin/python/plugin.h @@ -1,10 +1,10 @@ #ifndef PPPLUGIN_PYTHON_PLUGIN_H #define PPPLUGIN_PYTHON_PLUGIN_H -#include "detail/function_details.h" -#include "errors.h" -#include "expected.h" -#include "python/python_interpreter.h" +#include "ppplugin/detail/function_details.h" +#include "ppplugin/errors.h" +#include "ppplugin/expected.h" +#include "ppplugin/python/python_interpreter.h" #include diff --git a/include/ppplugin/python/python_interpreter.h b/include/ppplugin/python/python_interpreter.h index 98d3e34..592ff9d 100644 --- a/include/ppplugin/python/python_interpreter.h +++ b/include/ppplugin/python/python_interpreter.h @@ -1,9 +1,9 @@ #ifndef PPPLUGIN_PYTHON_INTERPRETER_H #define PPPLUGIN_PYTHON_INTERPRETER_H -#include "errors.h" -#include "python/python_guard.h" +#include "ppplugin/errors.h" #include "python_forward_defs.h" +#include "python_guard.h" #include "python_object.h" #include "python_tuple.h" diff --git a/include/ppplugin/python/python_tuple.h b/include/ppplugin/python/python_tuple.h index 2461b1c..a31837c 100644 --- a/include/ppplugin/python/python_tuple.h +++ b/include/ppplugin/python/python_tuple.h @@ -5,7 +5,6 @@ #include "python_object.h" #include -#include #include #include diff --git a/src/boost_dll_loader.cpp b/src/boost_dll_loader.cpp index 62fc600..3921253 100644 --- a/src/boost_dll_loader.cpp +++ b/src/boost_dll_loader.cpp @@ -1,4 +1,4 @@ -#include "errors.h" +#include "ppplugin/errors.h" #include #include diff --git a/src/lua_script.cpp b/src/lua_script.cpp index 0ad710e..673d003 100644 --- a/src/lua_script.cpp +++ b/src/lua_script.cpp @@ -1,8 +1,8 @@ -#include "lua/lua_script.h" -#include "detail/compatibility_utils.h" -#include "errors.h" -#include "expected.h" -#include "lua/lua_state.h" +#include "ppplugin/lua/lua_script.h" +#include "ppplugin/detail/compatibility_utils.h" +#include "ppplugin/errors.h" +#include "ppplugin/expected.h" +#include "ppplugin/lua/lua_state.h" #include #include diff --git a/src/lua_state.cpp b/src/lua_state.cpp index 911c342..b2be374 100644 --- a/src/lua_state.cpp +++ b/src/lua_state.cpp @@ -1,4 +1,4 @@ -#include "lua/lua_state.h" +#include "ppplugin/lua/lua_state.h" #include #include diff --git a/src/python_exception.cpp b/src/python_exception.cpp index 665bf6d..aa9f02c 100644 --- a/src/python_exception.cpp +++ b/src/python_exception.cpp @@ -1,6 +1,6 @@ -#include "python/python_exception.h" -#include "detail/compatibility_utils.h" -#include "python/python_object.h" +#include "ppplugin/python/python_exception.h" +#include "ppplugin/detail/compatibility_utils.h" +#include "ppplugin/python/python_object.h" #include #include diff --git a/src/python_guard.cpp b/src/python_guard.cpp index 5094d2c..4b68bda 100644 --- a/src/python_guard.cpp +++ b/src/python_guard.cpp @@ -1,5 +1,5 @@ -#include "python/python_guard.h" -#include "python/python_forward_defs.h" +#include "ppplugin/python/python_guard.h" +#include "ppplugin/python/python_forward_defs.h" #define PY_SSIZE_T_CLEAN #include // NOLINT(misc-include-cleaner) diff --git a/src/python_interpreter.cpp b/src/python_interpreter.cpp index c4f36a4..c608f66 100644 --- a/src/python_interpreter.cpp +++ b/src/python_interpreter.cpp @@ -1,9 +1,9 @@ -#include "python/python_interpreter.h" -#include "errors.h" -#include "python/python_exception.h" -#include "python/python_forward_defs.h" -#include "python/python_guard.h" -#include "python/python_object.h" +#include "ppplugin/python/python_interpreter.h" +#include "ppplugin/errors.h" +#include "ppplugin/python/python_exception.h" +#include "ppplugin/python/python_forward_defs.h" +#include "ppplugin/python/python_guard.h" +#include "ppplugin/python/python_object.h" #include #include diff --git a/src/python_object.cpp b/src/python_object.cpp index 9b90a9d..a858fd8 100644 --- a/src/python_object.cpp +++ b/src/python_object.cpp @@ -1,4 +1,4 @@ -#include "python/python_object.h" +#include "ppplugin/python/python_object.h" #include #include diff --git a/src/python_plugin.cpp b/src/python_plugin.cpp index d64bf54..3c11c85 100644 --- a/src/python_plugin.cpp +++ b/src/python_plugin.cpp @@ -1,6 +1,6 @@ -#include "errors.h" -#include "expected.h" -#include "python/plugin.h" +#include "ppplugin/errors.h" +#include "ppplugin/expected.h" +#include "ppplugin/python/plugin.h" #include diff --git a/src/python_tuple.cpp b/src/python_tuple.cpp index af0b42c..f8114a7 100644 --- a/src/python_tuple.cpp +++ b/src/python_tuple.cpp @@ -1,5 +1,5 @@ -#include "python/python_tuple.h" -#include "python/python_forward_defs.h" +#include "ppplugin/python/python_tuple.h" +#include "ppplugin/python/python_forward_defs.h" #include #include From 1ab66dedf9e335b93cababc0ab378baa48c5fe0e Mon Sep 17 00:00:00 2001 From: Tamino Bauknecht Date: Tue, 26 Nov 2024 22:36:30 +0100 Subject: [PATCH 3/5] examples: Adapt ppplugin include paths --- examples/configurable_plugin/configurable_plugin.cpp | 1 + .../configurable_plugin_manager.cpp | 7 ++++--- examples/lua_plugin/lua_plugin_manager.cpp | 6 +++--- .../multi_language_plugin_manager.cpp | 10 +++++----- examples/multi_language_plugin/plugins/cpp_plugin.cpp | 3 ++- .../multi_return_lua_plugin_manager.cpp | 4 ++-- examples/python_plugin/python_plugin_manager.cpp | 6 +++--- examples/simple_plugin/simple_plugin_manager.cpp | 7 ++++--- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/examples/configurable_plugin/configurable_plugin.cpp b/examples/configurable_plugin/configurable_plugin.cpp index fee0961..54d83e1 100644 --- a/examples/configurable_plugin/configurable_plugin.cpp +++ b/examples/configurable_plugin/configurable_plugin.cpp @@ -1,6 +1,7 @@ #include "configurable_plugin.h" #include + #include BOOST_DLL_ALIAS(ConfigurablePluginA::create, create_a); diff --git a/examples/configurable_plugin/configurable_plugin_manager.cpp b/examples/configurable_plugin/configurable_plugin_manager.cpp index a73c4b1..14856cd 100644 --- a/examples/configurable_plugin/configurable_plugin_manager.cpp +++ b/examples/configurable_plugin/configurable_plugin_manager.cpp @@ -1,6 +1,3 @@ -#include "configurable_plugin.h" -#include "cpp/plugin.h" -#include "plugin_manager.h" #include #include #include @@ -10,6 +7,10 @@ #include #include +#include "configurable_plugin.h" +#include "ppplugin/cpp/plugin.h" +#include "ppplugin/plugin_manager.h" + int main(int argc, char* argv[]) { try { diff --git a/examples/lua_plugin/lua_plugin_manager.cpp b/examples/lua_plugin/lua_plugin_manager.cpp index 88a95b0..2e431fa 100644 --- a/examples/lua_plugin/lua_plugin_manager.cpp +++ b/examples/lua_plugin/lua_plugin_manager.cpp @@ -1,6 +1,3 @@ -#include "lua/plugin.h" -#include "plugin_manager.h" - #include #include #include @@ -9,6 +6,9 @@ #include #include +#include "ppplugin/lua/plugin.h" +#include "ppplugin/plugin_manager.h" + int main(int argc, char* argv[]) { try { diff --git a/examples/multi_language_plugin/multi_language_plugin_manager.cpp b/examples/multi_language_plugin/multi_language_plugin_manager.cpp index d38a7a9..dd98d88 100644 --- a/examples/multi_language_plugin/multi_language_plugin_manager.cpp +++ b/examples/multi_language_plugin/multi_language_plugin_manager.cpp @@ -1,8 +1,3 @@ -#include "errors.h" -#include "noop_plugin.h" -#include "plugin.h" -#include "plugin_manager.h" - #include #include #include @@ -12,6 +7,11 @@ #include #include +#include "ppplugin/errors.h" +#include "ppplugin/noop_plugin.h" +#include "ppplugin/plugin.h" +#include "ppplugin/plugin_manager.h" + int main(int argc, char* argv[]) { if (argc < 1) { diff --git a/examples/multi_language_plugin/plugins/cpp_plugin.cpp b/examples/multi_language_plugin/plugins/cpp_plugin.cpp index 42a2087..d84aa12 100644 --- a/examples/multi_language_plugin/plugins/cpp_plugin.cpp +++ b/examples/multi_language_plugin/plugins/cpp_plugin.cpp @@ -1,6 +1,7 @@ -#include #include +#include + void initialize() { std::cout << "C++ initialize" << '\n'; diff --git a/examples/multi_return_lua_plugin/multi_return_lua_plugin_manager.cpp b/examples/multi_return_lua_plugin/multi_return_lua_plugin_manager.cpp index 2c4bb78..8e549fa 100644 --- a/examples/multi_return_lua_plugin/multi_return_lua_plugin_manager.cpp +++ b/examples/multi_return_lua_plugin/multi_return_lua_plugin_manager.cpp @@ -1,10 +1,10 @@ -#include "plugin_manager.h" - #include #include #include #include +#include "ppplugin/plugin_manager.h" + int main(int argc, char* argv[]) { try { diff --git a/examples/python_plugin/python_plugin_manager.cpp b/examples/python_plugin/python_plugin_manager.cpp index 6d79f72..fcdeca0 100644 --- a/examples/python_plugin/python_plugin_manager.cpp +++ b/examples/python_plugin/python_plugin_manager.cpp @@ -1,6 +1,3 @@ -#include "plugin_manager.h" -#include "python/plugin.h" - #include #include #include @@ -10,6 +7,9 @@ #include #include +#include "ppplugin/plugin_manager.h" +#include "ppplugin/python/plugin.h" + int main(int argc, char* argv[]) { try { diff --git a/examples/simple_plugin/simple_plugin_manager.cpp b/examples/simple_plugin/simple_plugin_manager.cpp index afd4e52..1d5d170 100644 --- a/examples/simple_plugin/simple_plugin_manager.cpp +++ b/examples/simple_plugin/simple_plugin_manager.cpp @@ -7,9 +7,10 @@ #include #include -#include "cpp/plugin.h" -#include "errors.h" -#include "plugin_manager.h" +#include "ppplugin/cpp/plugin.h" +#include "ppplugin/errors.h" +#include "ppplugin/plugin_manager.h" + #include "simple_plugin.h" void printError(std::string_view function_name, const ppplugin::CallError& error) From 0150683400f977dba1518b0aef20979b4ef06974 Mon Sep 17 00:00:00 2001 From: Tamino Bauknecht Date: Tue, 26 Nov 2024 22:40:07 +0100 Subject: [PATCH 4/5] test: Adapt ppplugin include paths --- test/detail_templates_tests.cpp | 2 +- test/expected_tests.cpp | 2 +- test/scope_guard_tests.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/detail_templates_tests.cpp b/test/detail_templates_tests.cpp index 2f01646..f180dc1 100644 --- a/test/detail_templates_tests.cpp +++ b/test/detail_templates_tests.cpp @@ -1,4 +1,4 @@ -#include "detail/template_helpers.h" +#include "ppplugin/detail/template_helpers.h" #include #include diff --git a/test/expected_tests.cpp b/test/expected_tests.cpp index 3bd0e4b..40401dd 100644 --- a/test/expected_tests.cpp +++ b/test/expected_tests.cpp @@ -1,4 +1,4 @@ -#include "expected.h" +#include "ppplugin/expected.h" #include "test_helper.h" #include "test_types.h" diff --git a/test/scope_guard_tests.cpp b/test/scope_guard_tests.cpp index 37cde97..7a0b1cc 100644 --- a/test/scope_guard_tests.cpp +++ b/test/scope_guard_tests.cpp @@ -1,4 +1,4 @@ -#include "detail/scope_guard.h" +#include "ppplugin/detail/scope_guard.h" #include #include From 812be55378d5666cc0fd49ec5854896b2de7a797 Mon Sep 17 00:00:00 2001 From: Tamino Bauknecht Date: Tue, 26 Nov 2024 23:26:33 +0100 Subject: [PATCH 5/5] cmake: Fix conditional linking of fmt If a simple "if" is used instead, the generated cmake target files will include the fmt dependency no matter what the surrounding "if" is evaluated to. With the generator expression, cmake can detect on generation of the files if the dependency should be included or not. --- src/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9a02424..1be4a5f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,10 +17,8 @@ target_link_libraries( ${LIBRARY_TARGET} PUBLIC Boost::filesystem PUBLIC Python::Python - PRIVATE ${LUA_LIBRARIES}) -if(${PPPLUGIN_ENABLE_CPP17_COMPATIBILITY}) - target_link_libraries(${LIBRARY_TARGET} PUBLIC fmt::fmt) -endif() + PRIVATE ${LUA_LIBRARIES} + PUBLIC $<$:fmt::fmt>) target_include_directories( ${LIBRARY_TARGET} PRIVATE ${LUA_INCLUDE_DIR}