Skip to content

Commit

Permalink
fix: insecure RUNPATH in arch
Browse files Browse the repository at this point in the history
  I don't know why RUNPATH is exist when linked ${LIB_NAME}.
so i skip it explicitly.
  • Loading branch information
18202781743 committed Dec 15, 2023
1 parent 7a417e4 commit a7c09ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cmake/DtkBuildConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function(dtk_extend_target TARGET)
set(args_option)
set(args_single
EnableCov
SkipRPATH
)
cmake_parse_arguments(PARSE_ARGV 1 arg "${args_option}" "${args_single}" "${args_multi}")

Expand All @@ -99,4 +100,9 @@ function(dtk_extend_target TARGET)
endif()
target_link_libraries(${TARGET} PRIVATE gcov)
endif()

# skip RUNPATH avoid to `Insecure RUNPATH`
if (arg_SkipRPATH)
set_target_properties(${TARGET} PROPERTIES SKIP_BUILD_RPATH ${arg_SkipRPATH})
endif()
endfunction()
4 changes: 3 additions & 1 deletion qt6/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ qt_add_qml_module(${LIB_NAME}
)

dtk_extend_target(${LIB_NAME} EnableCov ${ENABLE_COV})
dtk_extend_target(${PLUGIN_NAME} EnableCov ${ENABLE_COV})
dtk_extend_target(${PLUGIN_NAME} EnableCov ${ENABLE_COV}
SkipRPATH ON
)

qt_add_translations(${LIB_NAME}
TS_FILES ${TS_FILES}
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/settings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ qt_add_qml_module(dtkdeclarativesettingsplugin
"${PLUGIN_OUTPUT_DIR}/${URI_PATH}/settings"
)

dtk_extend_target(dtkdeclarativesettingsplugin EnableCov ${ENABLE_COV})
dtk_extend_target(dtkdeclarativesettingsplugin EnableCov ${ENABLE_COV}
SkipRPATH ON
)

target_link_libraries(dtkdeclarativesettingsplugin
PRIVATE
Expand Down

0 comments on commit a7c09ac

Please sign in to comment.