Skip to content

Commit 7a7600c

Browse files
committed
feat: add endstone_ prefix to compiled lib
1 parent 29e2042 commit 7a7600c

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
name: example-plugin-windows
3838
path: |
39-
./build/*_plugin.dll
40-
./build/*_plugin.pdb
39+
./build/endstone_*.dll
40+
./build/endstone_*.pdb
4141
4242
build_linux:
4343
name: Build on Ubuntu
@@ -74,4 +74,4 @@ jobs:
7474
uses: actions/upload-artifact@v4
7575
with:
7676
name: example-plugin-linux
77-
path: ./build/*_plugin.so
77+
path: ./build/endstone_*.so

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.15)
22

3-
project(endstone_cpp_example CXX)
3+
project(cpp_example CXX)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -16,10 +16,9 @@ FetchContent_MakeAvailable(endstone)
1616
add_library(${PROJECT_NAME} SHARED src/example_plugin.cpp)
1717
target_include_directories(${PROJECT_NAME} PUBLIC include)
1818
target_link_libraries(${PROJECT_NAME} PRIVATE endstone::headers)
19+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "endstone_")
1920

20-
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
21-
target_compile_definitions(${PROJECT_NAME} PRIVATE _ITERATOR_DEBUG_LEVEL=0)
22-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
21+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
2322
target_compile_options(${PROJECT_NAME} PRIVATE -stdlib=libc++ -fPIC)
2423
target_link_libraries(${PROJECT_NAME} PRIVATE -static-libgcc -static-libstdc++ libc++.a libc++abi.a)
2524
endif ()

src/example_plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "example_plugin.h"
44

55
// The ENDSTONE_PLUGIN macro defines the metadata for the plugin.
6-
ENDSTONE_PLUGIN(/*name=*/"endstone_cpp_example", /*version=*/"0.4.0", /*main_class=*/ExamplePlugin)
6+
ENDSTONE_PLUGIN(/*name=*/"cpp_example", /*version=*/"0.4.0", /*main_class=*/ExamplePlugin)
77
{
88
prefix = "CppExamplePlugin";
99
description = "C++ example plugin for Endstone servers";

0 commit comments

Comments
 (0)