Skip to content

Commit

Permalink
Review update
Browse files Browse the repository at this point in the history
  • Loading branch information
lordgamez committed Nov 14, 2024
1 parent 0e1f0b8 commit ab2bb5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions extensions/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ endif()

include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)

add_minifi_library(minifi-python-lib-loader-extension SHARED pythonlibloader/PythonLibLoader.cpp)
target_link_libraries(minifi-python-lib-loader-extension PRIVATE ${LIBMINIFI})
if (NOT WIN32 AND NOT APPLE)
add_minifi_library(minifi-python-lib-loader-extension SHARED pythonlibloader/PythonLibLoader.cpp)
target_link_libraries(minifi-python-lib-loader-extension PRIVATE ${LIBMINIFI})
endif()

file(GLOB SOURCES "*.cpp" "types/*.cpp" "pythonloader/PyProcLoader.cpp")

Expand Down
10 changes: 4 additions & 6 deletions extensions/python/pythonlibloader/PythonLibLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(WIN32) && !defined(__APPLE__)
#include <dlfcn.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <array>
#include "utils/StringUtils.h"
#include "core/logging/LoggerConfiguration.h"
#endif
#include "core/extension/Extension.h"

#if defined(WIN32) || defined(__APPLE__)
static_assert(false, "The Python library loader should only be used on Linux.");
#endif

namespace minifi = org::apache::nifi::minifi;

#if !defined(WIN32) && !defined(__APPLE__)
class PythonLibLoader {
public:
explicit PythonLibLoader(const std::shared_ptr<minifi::Configure>& config) {
Expand Down Expand Up @@ -87,12 +88,9 @@ class PythonLibLoader {
void* lib_python_handle_ = nullptr;
std::shared_ptr<minifi::core::logging::Logger> logger_ = minifi::core::logging::LoggerFactory<PythonLibLoader>::getLogger();
};
#endif

static bool init([[maybe_unused]] const std::shared_ptr<minifi::Configure>& config) {
#if !defined(WIN32) && !defined(__APPLE__)
static PythonLibLoader python_lib_loader(config);
#endif
return true;
}

Expand Down

0 comments on commit ab2bb5f

Please sign in to comment.