diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c168615..8feacef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,8 +36,8 @@ jobs: with: name: example-plugin-windows path: | - ./build/*_plugin.dll - ./build/*_plugin.pdb + ./build/endstone_*.dll + ./build/endstone_*.pdb build_linux: name: Build on Ubuntu @@ -74,4 +74,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: example-plugin-linux - path: ./build/*_plugin.so \ No newline at end of file + path: ./build/endstone_*.so \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 439e481..0f53e4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(endstone_cpp_example CXX) +project(cpp_example CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -16,10 +16,9 @@ FetchContent_MakeAvailable(endstone) add_library(${PROJECT_NAME} SHARED src/example_plugin.cpp) target_include_directories(${PROJECT_NAME} PUBLIC include) target_link_libraries(${PROJECT_NAME} PRIVATE endstone::headers) +set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "endstone_") -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_compile_definitions(${PROJECT_NAME} PRIVATE _ITERATOR_DEBUG_LEVEL=0) -elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${PROJECT_NAME} PRIVATE -stdlib=libc++ -fPIC) target_link_libraries(${PROJECT_NAME} PRIVATE -static-libgcc -static-libstdc++ libc++.a libc++abi.a) endif () \ No newline at end of file diff --git a/src/example_plugin.cpp b/src/example_plugin.cpp index 3aee7aa..9b4a4a1 100644 --- a/src/example_plugin.cpp +++ b/src/example_plugin.cpp @@ -3,7 +3,7 @@ #include "example_plugin.h" // The ENDSTONE_PLUGIN macro defines the metadata for the plugin. -ENDSTONE_PLUGIN(/*name=*/"endstone_cpp_example", /*version=*/"0.4.0", /*main_class=*/ExamplePlugin) +ENDSTONE_PLUGIN(/*name=*/"cpp_example", /*version=*/"0.4.0", /*main_class=*/ExamplePlugin) { prefix = "CppExamplePlugin"; description = "C++ example plugin for Endstone servers";