Skip to content

Commit

Permalink
Update plugin init
Browse files Browse the repository at this point in the history
  • Loading branch information
epernod committed Aug 29, 2024
1 parent bfaef3e commit 9e1ad48
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
pull_request:
push:

jobs:
Expand Down Expand Up @@ -79,14 +80,6 @@ jobs:
echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV
fi
if [[ "$RUNNER_OS" == "macOS" ]]; then
echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV
fi
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV
fi
- name: Run Tearing_test
if: always()
shell: bash
Expand Down
28 changes: 17 additions & 11 deletions src/Tearing/initTearing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
****************************************************************************/
#include <Tearing/initTearing.h>

#include <sofa/core/ObjectFactory.h>
using sofa::core::ObjectFactory;

namespace sofa::component
{

Expand All @@ -35,7 +38,7 @@ extern "C" {
TEARING_API const char* getModuleComponentList();
}

void initExternalModule()
void initTearing()
{
static bool first = true;
if (first)
Expand All @@ -44,14 +47,21 @@ void initExternalModule()
}
}

void initExternalModule()
{
initTearing();
}



const char* getModuleName()
{
return "tearing";
return sofa_tostring(SOFA_TARGET);
}

const char* getModuleVersion()
{
return "1.0";
return sofa_tostring(TEARING_VERSION);
}

const char* getModuleLicense()
Expand All @@ -66,14 +76,10 @@ const char* getModuleDescription()

const char* getModuleComponentList()
{
// string containing the names of the classes provided by the plugin
return "TearingEngine, TearingAlgorithms, VolumeTearingEngine, VolumeTearingAlgorithms";
}


void init()
{
initExternalModule();
/// string containing the names of the classes provided by the plugin
static std::string classes = ObjectFactory::getInstance()->listClassesFromTarget(sofa_tostring(SOFA_TARGET));
return classes.c_str();
}


} // namespace sofa::component
3 changes: 2 additions & 1 deletion src/Tearing/initTearing.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* Authors: see Authors.txt *
* Further information: https://infinytech3d.com *
****************************************************************************/
#pragma once
#include <Tearing/config.h>

namespace sofa::component
{
TEARING_API void init();
void TEARING_API initTearing();
} // namespace sofa::component

0 comments on commit 9e1ad48

Please sign in to comment.