Skip to content

Commit

Permalink
Always preserve source permissions in vendor packages (#645)
Browse files Browse the repository at this point in the history
In vendor packages where we're installing an executable, we use
USE_SOURCE_PERMISSIONS to make sure that the executable permissions on
the binaries are maintained when the external project's staging
directory is recursively installed to the final installation directory.

In most of our vendor packages, we aren't using that flag where we don't
expect an executable binary to be installed. However, for reasons I
won't go into here, some systems use executable permissions on shared
object libraries as well. The linker seems to handle this on our behalf,
but we're losing the permissions during the recursive copy operation if
we don't use this flag.

Signed-off-by: Scott K Logan <logans@cottsay.net>
  • Loading branch information
cottsay authored Feb 11, 2021
1 parent 68897af commit 2be25a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion sqlite3_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ if (NOT SQLite3_FOUND)
)

# The external project will install to the build folder, but we'll install that on make install.
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sqlite3_install/ DESTINATION ${CMAKE_INSTALL_PREFIX})
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sqlite3_install/
DESTINATION ${CMAKE_INSTALL_PREFIX}
USE_SOURCE_PERMISSIONS)
else ()
message(STATUS "Found SQLite3. Using SQLite3 from system.")
endif ()
Expand Down
3 changes: 2 additions & 1 deletion zstd_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ macro(build_zstd)

install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install/
DESTINATION ${CMAKE_INSTALL_PREFIX})
DESTINATION ${CMAKE_INSTALL_PREFIX}
USE_SOURCE_PERMISSIONS)
endmacro()

if (NOT zstd_FOUND OR "${zstd_VERSION}" VERSION_LESS 1.4.4)
Expand Down

0 comments on commit 2be25a6

Please sign in to comment.