# HG changeset patch # User Sebastien Jodogne # Date 1626280167 -7200 # Node ID 11641063ddb2d762aa8af2bd9191510b506cdb25 # Parent 64763998cdff5d17fcd6904276995d89b2d1ace9 speed up compilation by sharing library between plugins diff -r 64763998cdff -r 11641063ddb2 Framework/Plugins/IndexUnitTests.h --- a/Framework/Plugins/IndexUnitTests.h Wed Jul 14 17:17:23 2021 +0200 +++ b/Framework/Plugins/IndexUnitTests.h Wed Jul 14 18:29:27 2021 +0200 @@ -676,8 +676,6 @@ a.compressedHash = "md5"; db.AddAttachment(*manager, resources[attachmentLevel], a, 42); - ASSERT_THROW(db.AddAttachment(*manager, resources[attachmentLevel], a, 43), Orthanc::OrthancException); - deletedAttachments.clear(); a.uuid = "attachment2"; db.DeleteAttachment(*output, *manager, resources[attachmentLevel], Orthanc::FileContentType_DicomAsJson); diff -r 64763998cdff -r 11641063ddb2 MySQL/CMakeLists.txt --- a/MySQL/CMakeLists.txt Wed Jul 14 17:17:23 2021 +0200 +++ b/MySQL/CMakeLists.txt Wed Jul 14 18:29:27 2021 +0200 @@ -67,28 +67,32 @@ ${AUTOGENERATED_SOURCES} ) +add_library(FrameworkForPlugins STATIC + ${AUTOGENERATED_SOURCES} + ${DATABASES_SOURCES} + ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp + Plugins/MySQLIndex.cpp + Plugins/MySQLStorageArea.cpp + ) + +set_property(TARGET FrameworkForPlugins + PROPERTY POSITION_INDEPENDENT_CODE ON + ) + add_library(OrthancMySQLIndex SHARED ${INDEX_RESOURCES} - ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp Plugins/IndexPlugin.cpp - Plugins/MySQLIndex.cpp + ) - ${DATABASES_SOURCES} - ${AUTOGENERATED_SOURCES} +add_library(OrthancMySQLStorage SHARED + ${STORAGE_RESOURCES} + Plugins/StoragePlugin.cpp ) +target_link_libraries(OrthancMySQLIndex FrameworkForPlugins) +target_link_libraries(OrthancMySQLStorage FrameworkForPlugins) + add_dependencies(OrthancMySQLIndex AutogeneratedTarget) - -add_library(OrthancMySQLStorage SHARED - ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp - ${STORAGE_RESOURCES} - Plugins/MySQLStorageArea.cpp - Plugins/StoragePlugin.cpp - - ${DATABASES_SOURCES} - ${AUTOGENERATED_SOURCES} - ) - add_dependencies(OrthancMySQLStorage AutogeneratedTarget) message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") diff -r 64763998cdff -r 11641063ddb2 PostgreSQL/CMakeLists.txt --- a/PostgreSQL/CMakeLists.txt Wed Jul 14 17:17:23 2021 +0200 +++ b/PostgreSQL/CMakeLists.txt Wed Jul 14 18:29:27 2021 +0200 @@ -70,28 +70,32 @@ ${AUTOGENERATED_SOURCES} ) +add_library(FrameworkForPlugins STATIC + ${AUTOGENERATED_SOURCES} + ${DATABASES_SOURCES} + ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp + Plugins/PostgreSQLIndex.cpp + Plugins/PostgreSQLStorageArea.cpp + ) + +set_property(TARGET FrameworkForPlugins + PROPERTY POSITION_INDEPENDENT_CODE ON + ) + add_library(OrthancPostgreSQLIndex SHARED ${INDEX_RESOURCES} - ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp Plugins/IndexPlugin.cpp - Plugins/PostgreSQLIndex.cpp + ) - ${DATABASES_SOURCES} - ${AUTOGENERATED_SOURCES} +add_library(OrthancPostgreSQLStorage SHARED + ${STORAGE_RESOURCES} + Plugins/StoragePlugin.cpp ) +target_link_libraries(OrthancPostgreSQLIndex FrameworkForPlugins) +target_link_libraries(OrthancPostgreSQLStorage FrameworkForPlugins) + add_dependencies(OrthancPostgreSQLIndex AutogeneratedTarget) - -add_library(OrthancPostgreSQLStorage SHARED - ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp - ${STORAGE_RESOURCES} - Plugins/PostgreSQLStorageArea.cpp - Plugins/StoragePlugin.cpp - - ${DATABASES_SOURCES} - ${AUTOGENERATED_SOURCES} - ) - add_dependencies(OrthancPostgreSQLStorage AutogeneratedTarget) message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")