Ver Fonte

build system: BUILD_PLUGIN is no longer required, plugins are libs

Michele Caini há 6 anos atrás
pai
commit
f577183c24

+ 3 - 3
.github/workflows/build.yml

@@ -20,7 +20,7 @@ jobs:
       env:
         CXX: ${{ matrix.compiler }}
       run: |
-        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON -DBUILD_PLUGIN=ON ..
+        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON ..
         make -j4
     - name: Run tests
       working-directory: build
@@ -49,7 +49,7 @@ jobs:
     - name: Compile tests
       working-directory: build
       run: |
-        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON -DBUILD_PLUGIN=ON ${{ matrix.toolset_option }} ..
+        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON ${{ matrix.toolset_option }} ..
         cmake --build . -j 4
     - name: Run tests
       working-directory: build
@@ -66,7 +66,7 @@ jobs:
     - name: Compile tests
       working-directory: build
       run: |
-        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON -DBUILD_PLUGIN=ON ..
+        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON ..
         make -j4
     - name: Run tests
       working-directory: build

+ 1 - 1
.github/workflows/coverage.yml

@@ -16,7 +16,7 @@ jobs:
         CXXFLAGS: "-O0 --coverage -fno-inline -fno-inline-small-functions -fno-default-inline"
         CXX: g++
       run: |
-        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON -DBUILD_PLUGIN=ON ..
+        cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON ..
         make -j4
     - name: Run tests
       working-directory: build

+ 0 - 1
CMakeLists.txt

@@ -161,7 +161,6 @@ if(BUILD_TESTING)
     option(BUILD_BENCHMARK "Build benchmark." OFF)
     option(BUILD_LIB "Build lib example." OFF)
     option(BUILD_MOD "Build mod example." OFF)
-    option(BUILD_PLUGIN "Build plugin example." OFF)
     option(BUILD_SNAPSHOT "Build snapshot example." OFF)
 
     enable_testing()

+ 17 - 21
test/CMakeLists.txt

@@ -56,14 +56,14 @@ macro(SETUP_LIB_TEST TEST_NAME)
 endmacro()
 
 macro(SETUP_PLUGIN_TEST TEST_NAME)
-    add_library(_${TEST_NAME}_plugin MODULE plugin/${TEST_NAME}/plugin.cpp)
-    SETUP_TARGET(_${TEST_NAME}_plugin)
-    SETUP_BASIC_TEST(lib_${TEST_NAME}_plugin plugin/${TEST_NAME}/main.cpp)
-    target_link_libraries(lib_${TEST_NAME}_plugin PRIVATE ${CMAKE_DL_LIBS})
-    target_include_directories(lib_${TEST_NAME}_plugin PRIVATE ${CR_SRC_DIR})
-    target_compile_definitions(lib_${TEST_NAME}_plugin PRIVATE NOMINMAX PLUGIN="$<TARGET_FILE:_${TEST_NAME}_plugin>")
-    target_include_directories(_${TEST_NAME}_plugin PRIVATE ${CR_SRC_DIR})
-    target_compile_definitions(_${TEST_NAME}_plugin PRIVATE NOMINMAX)
+    add_library(_${TEST_NAME} MODULE lib/${TEST_NAME}/plugin.cpp)
+    SETUP_TARGET(_${TEST_NAME})
+    SETUP_BASIC_TEST(lib_${TEST_NAME} lib/${TEST_NAME}/main.cpp)
+    target_link_libraries(lib_${TEST_NAME} PRIVATE ${CMAKE_DL_LIBS})
+    target_include_directories(lib_${TEST_NAME} PRIVATE ${CR_SRC_DIR})
+    target_compile_definitions(lib_${TEST_NAME} PRIVATE NOMINMAX PLUGIN="$<TARGET_FILE:_${TEST_NAME}>")
+    target_include_directories(_${TEST_NAME} PRIVATE ${CR_SRC_DIR})
+    target_compile_definitions(_${TEST_NAME} PRIVATE NOMINMAX)
 endmacro()
 
 # Test benchmark
@@ -75,25 +75,21 @@ endif()
 # Test lib
 
 if(BUILD_LIB)
-    SETUP_LIB_TEST(dispatcher)
-    SETUP_LIB_TEST(emitter)
-    SETUP_LIB_TEST(meta)
-    SETUP_LIB_TEST(registry)
-endif()
-
-# Test plugin
-
-if(BUILD_PLUGIN)
     set(CR_DEPS_DIR ${EnTT_SOURCE_DIR}/deps/cr)
     configure_file(${EnTT_SOURCE_DIR}/cmake/in/cr.in ${CR_DEPS_DIR}/CMakeLists.txt)
     execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${CR_DEPS_DIR})
     execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${CR_DEPS_DIR})
     set(CR_SRC_DIR ${CR_DEPS_DIR}/src)
 
-    SETUP_PLUGIN_TEST(dispatcher)
-    SETUP_PLUGIN_TEST(emitter)
-    SETUP_PLUGIN_TEST(meta)
-    SETUP_PLUGIN_TEST(registry)
+    SETUP_LIB_TEST(dispatcher)
+    SETUP_LIB_TEST(emitter)
+    SETUP_LIB_TEST(meta)
+    SETUP_LIB_TEST(registry)
+
+    SETUP_PLUGIN_TEST(dispatcher_plugin)
+    SETUP_PLUGIN_TEST(emitter_plugin)
+    SETUP_PLUGIN_TEST(meta_plugin)
+    SETUP_PLUGIN_TEST(registry_plugin)
 endif()
 
 # Test mod

+ 0 - 0
test/plugin/dispatcher/main.cpp → test/lib/dispatcher_plugin/main.cpp


+ 0 - 0
test/plugin/dispatcher/plugin.cpp → test/lib/dispatcher_plugin/plugin.cpp


+ 0 - 0
test/plugin/dispatcher/types.h → test/lib/dispatcher_plugin/types.h


+ 0 - 0
test/plugin/emitter/main.cpp → test/lib/emitter_plugin/main.cpp


+ 0 - 0
test/plugin/emitter/plugin.cpp → test/lib/emitter_plugin/plugin.cpp


+ 0 - 0
test/plugin/emitter/types.h → test/lib/emitter_plugin/types.h


+ 0 - 0
test/plugin/meta/main.cpp → test/lib/meta_plugin/main.cpp


+ 0 - 0
test/plugin/meta/plugin.cpp → test/lib/meta_plugin/plugin.cpp


+ 0 - 0
test/plugin/meta/types.h → test/lib/meta_plugin/types.h


+ 0 - 0
test/plugin/registry/main.cpp → test/lib/registry_plugin/main.cpp


+ 0 - 0
test/plugin/registry/plugin.cpp → test/lib/registry_plugin/plugin.cpp


+ 0 - 0
test/plugin/registry/types.h → test/lib/registry_plugin/types.h