Skip to content

Commit

Permalink
Make plugin_base header-only, cleanup linking
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelpro committed Jun 12, 2021
1 parent 2913e65 commit 3530d65
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ blank_line_before_nested_class_or_def=False
# 'key1': 'value1',
# 'key2': 'value2',
# })
coalesce_brackets=False
coalesce_brackets=True

# The column limit.
column_limit=79
Expand Down Expand Up @@ -177,7 +177,7 @@ indent_dictionary_value=False
indent_width=2

# Join short lines into one line. E.g., single line 'if' statements.
join_multiple_lines=True
join_multiple_lines=False

# Do not include spaces around selected binary operators. For example:
#
Expand Down
2 changes: 1 addition & 1 deletion cmake/Event.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set_target_properties(EventLib PROPERTIES PREFIX ""
target_compile_features(EventLib PRIVATE cxx_std_20)
target_compile_options(EventLib PRIVATE ${OPTIONS})
target_include_directories(EventLib PRIVATE ${INCLUDES})
target_link_libraries(EventLib PUBLIC PluginLoaderLib)
target_link_libraries(EventLib PRIVATE PluginLoaderLib)
add_dependencies(EventLib swig_runtime)

# Module
Expand Down
3 changes: 1 addition & 2 deletions cmake/Exec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ set_target_properties(ExecLib PROPERTIES PREFIX ""
target_compile_features(ExecLib PRIVATE cxx_std_20)
target_compile_options(ExecLib PRIVATE ${OPTIONS})
target_include_directories(ExecLib PRIVATE ${INCLUDES})
target_link_libraries(ExecLib PUBLIC ${Boost_LOG_LIBRARY} PluginLoaderLib
EventLib)
target_link_libraries(ExecLib PRIVATE ${Boost_LOG_LIBRARY} EventLib)
add_dependencies(ExecLib swig_runtime)

# Module
Expand Down
4 changes: 2 additions & 2 deletions cmake/IO.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set_target_properties(IOLib PROPERTIES PREFIX ""
target_compile_features(IOLib PRIVATE cxx_std_20)
target_compile_options(IOLib PRIVATE ${OPTIONS})
target_include_directories(IOLib PRIVATE ${INCLUDES})
target_link_libraries(IOLib PUBLIC ${Boost_LOG_LIBRARY} ${LIBBOTAN} ProtoLib
PluginLoaderLib EventLib)
target_link_libraries(IOLib PRIVATE ${Boost_LOG_LIBRARY} ${LIBBOTAN} ProtoLib
EventLib)

# Module
set_property(SOURCE swig/IOCore.i PROPERTY CPLUSPLUS ON)
Expand Down
2 changes: 1 addition & 1 deletion cmake/PluginLoader.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Library
add_library(PluginLoaderLib SHARED src/plugin_loader.cpp src/plugin_base.cpp)
add_library(PluginLoaderLib SHARED src/plugin_loader.cpp)
set_target_properties(PluginLoaderLib PROPERTIES PREFIX ""
LIBRARY_OUTPUT_NAME libPluginLoader
LIBRARY_OUTPUT_DIRECTORY ${RKR_PACKAGE_ROOT}/lib
Expand Down
2 changes: 1 addition & 1 deletion cmake/Status.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ set_target_properties(StatusCore PROPERTIES OUTPUT_NAME CStatusCore
target_compile_features(StatusCore PRIVATE cxx_std_20)
target_compile_options(StatusCore PRIVATE ${OPTIONS})
target_include_directories(StatusCore PRIVATE ${INCLUDES})
target_link_libraries(StatusCore PluginLoaderLib IOLib EventLib)
target_link_libraries(StatusCore IOLib EventLib)
list(APPEND RIKER_DEPENDS StatusCore)
2 changes: 1 addition & 1 deletion cmake/World.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set_target_properties(WorldLib PROPERTIES PREFIX ""
target_compile_features(WorldLib PRIVATE cxx_std_20)
target_compile_options(WorldLib PRIVATE ${OPTIONS})
target_include_directories(WorldLib PRIVATE ${INCLUDES})
target_link_libraries(WorldLib PUBLIC ProtoLib PluginLoaderLib EventLib)
target_link_libraries(WorldLib PRIVATE ProtoLib EventLib)

set_property(SOURCE swig/WorldCore.i PROPERTY CPLUSPLUS ON)
swig_add_library(WorldCore
Expand Down
8 changes: 0 additions & 8 deletions src/plugin_base.cpp

This file was deleted.

3 changes: 2 additions & 1 deletion swig/EventCore.i
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@

%include <stdint.i>
%include <std_string.i>
%include "plugin_base.hpp"

%warnfilter(401) EventCore;
%include "event_core.hpp"
2 changes: 1 addition & 1 deletion swig/ExecCore.i
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
%include <stdint.i>
%include <std_string.i>

%include "plugin_base.hpp"
%warnfilter(401) ExecCore;
%include "exec_core.hpp"
3 changes: 2 additions & 1 deletion swig/IOCore.i
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
%include <stdint.i>
%include <std_string.i>
%include <pybuffer.i>
%include "plugin_base.hpp"

%typemap(out) (std::uint8_t[16]) {
$result = PyBytes_FromStringAndSize(reinterpret_cast<char*>($1), 16);
}

%warnfilter(401) IOCore;
%include "io_core.hpp"
2 changes: 1 addition & 1 deletion swig/StatusCore.i
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
%include <stdint.i>
%include <std_string.i>

%include "plugin_base.hpp"
%warnfilter(401) StatusCore;
%include "status_core.hpp"
2 changes: 1 addition & 1 deletion swig/WorldCore.i
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ struct BlockCoord {
%template(PosArray) std::array<std::int32_t, 3>;
%template(PosArrayVector) std::vector<std::array<std::int32_t, 3>>;

%include "plugin_base.hpp"
%warnfilter(401, 509) WorldCore;
%include "world_core.hpp"

0 comments on commit 3530d65

Please sign in to comment.