adamdebreceni commented on a change in pull request #1138:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1138#discussion_r678112156
##########
File path: cmake/Extensions.cmake
##########
@@ -26,7 +26,27 @@ macro(register_extension extension-name)
get_property(extensions GLOBAL PROPERTY EXTENSION-OPTIONS)
set_property(GLOBAL APPEND PROPERTY EXTENSION-OPTIONS ${extension-name})
target_compile_definitions(${extension-name} PRIVATE
"MODULE_NAME=${extension-name}")
- set_target_properties(${extension-name} PROPERTIES ENABLE_EXPORTS True)
+ set_target_properties(${extension-name} PROPERTIES
+ ENABLE_EXPORTS True
+ POSITION_INDEPENDENT_CODE ON)
+ if (WIN32)
+ set_target_properties(${extension-name} PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+ ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+ WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+ else()
+ set_target_properties(${extension-name} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+ endif()
+
+ if (WIN32)
+ install(TARGETS ${extension-name} RUNTIME DESTINATION extensions COMPONENT
bin)
+ else()
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ target_link_options(${extension-name} PRIVATE "-Wl,--disable-new-dtags")
Review comment:
without this, GCC sets the `RUNPATH` instead of the `RPATH`, there are
differences in precedence and inheritance, not entirely clear what the root
cause is, but without this test executables fail to start
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]