diff --git a/CMakeLists.txt b/CMakeLists.txt index 4540b92..a250cef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,6 @@ project(endstone_example_plugin CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0) @@ -20,7 +19,10 @@ elseif (UNIX) if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") message(FATAL_ERROR "Clang is required on Linux.") endif () - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fPIC") + link_libraries("-static-libgcc -static-libstdc++") + link_libraries(libc++.a) + link_libraries(libc++abi.a) else () message(FATAL_ERROR "${CMAKE_SYSTEM_NAME} (${CMAKE_SYSTEM_PROCESSOR}) is not supported") endif () @@ -63,7 +65,6 @@ add_library(${PROJECT_NAME} SHARED src/example_plugin.cpp) target_include_directories(${PROJECT_NAME} PUBLIC include) target_link_libraries(${PROJECT_NAME} PRIVATE endstone::headers) - # =============== # Install # ===============