Skip to content

Commit 6de7160

Browse files
committed
cmake: improve luarocks-based thirdparty projects
Ensure all luarocks build commands are run from a pristine source tree: - shared modules are already fully rebuilt by luarocks anyway (not incrementally) - this fix a potential issue if the luafilesystem build phase is triggered again: the luarocks build command will load the source tree previously built `lfs.so`, and segfault when the file is recreated while in use.
1 parent e84a6f5 commit 6de7160

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

thirdparty/cmake_modules/koreader_external_project.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ function(luarocks_external_project URL MD5)
373373
if(_SOURCE_SUBDIR)
374374
list(APPEND BUILD_CMD COMMAND cd ${_SOURCE_SUBDIR})
375375
endif()
376+
# First things first: go back to a pristine source tree…
377+
list(APPEND BUILD_CMD COMMAND clean_tree ${SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/source.list)
376378
list(APPEND BUILD_CMD COMMAND
377379
${STAGING_DIR}/bin/luarocks
378380
--tree ${BINARY_DIR}/dist make ${_ROCKSPEC}

0 commit comments

Comments
 (0)