Skip to content
Snippets Groups Projects
Commit 272d6f87 authored by Markus Frank's avatar Markus Frank Committed by MarkusFrankATcernch
Browse files

Fix plugin service linkage for MAC

parent 92f12255
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@
#define DD4HEP_CONDITIONS_DEBUG 1
/// Valid implementations of the Gaudi plugin service are 1 and 2
#define DD4HEP_PLUGINSVC_VERSION 2
#define DD4HEP_PLUGINSVC_VERSION 1
#ifdef DD4HEP_INSTANCE_COUNTS
#define INCREMENT_COUNTER InstanceCount::increment(this)
......@@ -36,6 +36,6 @@ namespace dd4hep {
/// Namespace for implementation details of the AIDA detector description toolkit
namespace detail {
} /* End namespace detail */
} /* End namespace dd4hep */
} /* End namespace detail */
} /* End namespace dd4hep */
#endif /* DD4HEP_CONFIG_H */
......@@ -11,7 +11,9 @@ if( APPLE )
endif()
target_compile_options(DD4hepGaudiPluginMgr PRIVATE -Wno-shadow)
target_compile_options(DD4hepGaudiPluginMgr PRIVATE -Wno-unused)
target_compile_options(DD4hepGaudiPluginMgr PRIVATE -Wno-unused-parameter)
target_compile_options(DD4hepGaudiPluginMgr PRIVATE -Wno-deprecated)
target_compile_options(DD4hepGaudiPluginMgr PRIVATE -Wno-keyword-macro)
target_compile_options(DD4hepGaudiPluginMgr PRIVATE -Wno-return-type-c-linkage)
target_link_libraries(DD4hepGaudiPluginMgr ${CMAKE_DL_LIBS} ${Boost_FILESYSTEM_LIBRARY} )
......
......@@ -33,16 +33,13 @@ namespace std {
#pragma clang diagnostic pop
#endif
#if GAUDI_PLUGIN_SERVICE_VERSION==2
#if GAUDI_PLUGIN_SERVICE_VERSION == 2
#define GAUDI_PLUGIN_SERVICE_V2 1
#include <Gaudi/PluginService.h>
using namespace Gaudi::PluginService::v2;
#elif GAUDI_PLUGIN_SERVICE_VERSION==1
#elif GAUDI_PLUGIN_SERVICE_VERSION == 1
#define private public
#define GAUDI_PLUGIN_SERVICE_V1 1
#include <Gaudi/PluginService.h>
using namespace Gaudi::PluginService::v1;
#undef private
#endif
......@@ -63,6 +60,7 @@ extern "C" {
/// Access factory by name
#if GAUDI_PLUGIN_SERVICE_VERSION==2
std::any MAKE_FUNC(create,GAUDI_PLUGIN_SERVICE_VERSION)(const char* id, const char* /* sig */) {
using namespace Gaudi::PluginService::v2;
const Details::Registry::FactoryInfo& info = Details::Registry::instance().getInfo(id, true);
return info.factory;
}
......@@ -76,6 +74,7 @@ extern "C" {
#if GAUDI_PLUGIN_SERVICE_VERSION==2
/// Add a new factory to the registry
void MAKE_FUNC(add_factory,GAUDI_PLUGIN_SERVICE_VERSION)(const char* id, std::any&& stub, const char* /* sig */, const char* /* ret */) {
using namespace Gaudi::PluginService::v2;
Details::Registry::Properties props = {};
std::string lib_name = "";
Details::Registry::instance().add( id, {lib_name, std::move( stub ), std::move( props )} );
......
......@@ -10,6 +10,7 @@ message(STATUS " *** Gaudi listcomponents: Generate map for ${libname} ..." )
if(APPLE)
SET ( ENV{DYLD_LIBRARY_PATH} ${genmap_install_dir}:$ENV{DYLD_LIBRARY_PATH}:$ENV{DD4HEP_LIBRARY_PATH} )
EXECUTE_PROCESS( COMMAND echo DYLD_LIBRARY_PATH = $ENV{DYLD_LIBRARY_PATH} )
else()
SET ( ENV{LD_LIBRARY_PATH} ${genmap_install_dir}:$ENV{LD_LIBRARY_PATH} )
#SET ( ENV{LD_PRELOAD} /lib64/libglapi.so )
......@@ -19,5 +20,3 @@ message(STATUS " *** Gaudi listcomponents: Generate map for ${libname} ..." )
${Gaudi_listcomponents_CMD} -o ${rootmapfile} ${libname}
WORKING_DIRECTORY ${genmap_install_dir}
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment