global export/import

This commit is contained in:
Green Sky 2024-05-28 10:57:40 +02:00
parent a023e5f46e
commit fb5397097b
No known key found for this signature in database
4 changed files with 39 additions and 10 deletions

View File

@ -29,6 +29,12 @@ jobs:
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
- name: Reconfig CMake for export
run: cmake ${{github.workspace}}/build -DSOLANACEAE_ECOSYSTEM_BUILD_PLUGINS=OFF
- name: Build with export
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 3
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
@ -52,6 +58,12 @@ jobs:
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 3
- name: Reconfig CMake for export
run: cmake ${{github.workspace}}/build -DSOLANACEAE_ECOSYSTEM_BUILD_PLUGINS=OFF
- name: Build with export
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 3
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
@ -86,6 +98,12 @@ jobs:
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 3
- name: Reconfig CMake for export
run: cmake ${{github.workspace}}/build -DSOLANACEAE_ECOSYSTEM_BUILD_PLUGINS=OFF
- name: Build with export
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 3
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

View File

@ -18,9 +18,18 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
option(SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS "Build plugins and not hosts (totato)" ON)
option(SOLANACEAE_ECOSYSTEM_BUILD_TESTING "Build tests" ${BUILD_TESTING})
message("II SOLANACEAE_ECOSYSTEM_BUILD_TESTING " ${SOLANACEAE_ECOSYSTEM_BUILD_TESTING})
if (SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS)
# uggly, but it needs to be defined for all dependencies too
# but this also means that we can not compile a host in the same cmake run as plugins
add_compile_definitions(ENTT_API_IMPORT)
else()
add_compile_definitions(ENTT_API_EXPORT)
endif()
if (SOLANACEAE_ECOSYSTEM_BUILD_TESTING)
include(CTest)
endif()

View File

@ -8,39 +8,42 @@ add_subdirectory(./entt)
add_subdirectory(./solanaceae_contact)
add_subdirectory(./solanaceae_message3)
set(SOLANACEAE_BRIDGE_BUILD_PLUGINS ON)
set(SOLANACEAE_BRIDGE_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_bridge)
set(SOLANACEAE_OBJECT_STORE_BUILD_TESTING ${SOLANACEAE_ECOSYSTEM_BUILD_TESTING})
add_subdirectory(./solanaceae_object_store)
add_subdirectory(./solanaceae_message_serializer)
set(SOLANACEAE_MESSAGE_FRAGMENT_STORE_BUILD_PLUGINS ON)
set(SOLANACEAE_MESSAGE_FRAGMENT_STORE_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_message_fragment_store)
add_subdirectory(./toxcore)
add_subdirectory(./solanaceae_toxcore)
add_subdirectory(./solanaceae_tox)
set(SOLANACEAE_TOX_UPNP_BUILD_PLUGINS ON)
set(SOLANACEAE_TOX_UPNP_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_tox_upnp)
add_subdirectory(./solanaceae_ngc_ft1)
set(SOLANACEAE_ZOX_BUILD_PLUGINS ON)
set(SOLANACEAE_ZOX_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_zox)
set(SOLANACEAE_TOXIC_GAMES_BUILD_PLUGINS ON)
set(SOLANACEAE_TOXIC_GAMES_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_toxic_games)
set(SOLANACEAE_IRCCLIENT_BUILD_PLUGINS ON)
set(SOLANACEAE_IRCCLIENT_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_ircclient)
set(SOLANACEAE_CRDTNOTES_BUILD_PLUGINS ON)
set(SOLANACEAE_CRDTNOTES_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_crdtnotes)
set(SOLANACEAE_LLAMA-CPP-WEB_BUILD_PLUGINS ON)
set(SOLANACEAE_LLAMA-CPP-WEB_BUILD_PLUGINS ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./solanaceae_llama-cpp-web)
add_subdirectory(./totato)
# plugins and hosts are mutally exclusive
if (NOT ${SOLANACEAE_ECOSYSTEM_BUILD_PLUGINS})
add_subdirectory(./totato)
endif()

View File

@ -6,7 +6,6 @@ add_library(plugin_ngcft1 MODULE
set_target_properties(plugin_ngcft1 PROPERTIES
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON # do we need this?
POSITION_INDEPENDENT_CODE ON
)
target_compile_definitions(plugin_ngcft1 PUBLIC ENTT_API_IMPORT)