diff options
-rw-r--r-- | third-party/cmake/BuildLuv.cmake | 4 | ||||
-rw-r--r-- | third-party/cmake/DownloadAndExtractFile.cmake | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/third-party/cmake/BuildLuv.cmake b/third-party/cmake/BuildLuv.cmake index e515823d57..9f8e4bbc4f 100644 --- a/third-party/cmake/BuildLuv.cmake +++ b/third-party/cmake/BuildLuv.cmake @@ -42,7 +42,9 @@ function(BuildLuv) -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luv -DURL=${LUV_URL} -DEXPECTED_SHA256=${LUV_SHA256} - -DTARGET=luv + -DTARGET=luv-static + # The source is shared with BuildLuarocks (with USE_BUNDLED_LUV). + -DSRC_DIR=${DEPS_BUILD_DIR}/src/luv -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake PATCH_COMMAND "${_luv_PATCH_COMMAND}" diff --git a/third-party/cmake/DownloadAndExtractFile.cmake b/third-party/cmake/DownloadAndExtractFile.cmake index 2fc6e0415f..15d22e5ca1 100644 --- a/third-party/cmake/DownloadAndExtractFile.cmake +++ b/third-party/cmake/DownloadAndExtractFile.cmake @@ -18,7 +18,10 @@ if(NOT DEFINED TARGET) message(FATAL_ERROR "TARGET must be defined.") endif() -set(SRC_DIR ${PREFIX}/src/${TARGET}) +if(NOT DEFINED SRC_DIR) + set(SRC_DIR ${PREFIX}/src/${TARGET}) +endif() +set(BINARY_DIR ${PREFIX}/src/${TARGET}-build) # Check whether the source has been downloaded. If true, skip it. # Useful for external downloads like homebrew. @@ -154,6 +157,13 @@ file(REMOVE_RECURSE ${SRC_DIR}) get_filename_component(contents ${contents} ABSOLUTE) file(RENAME ${contents} ${SRC_DIR}) +# Remove any existing BINARY_DIR, to force a new build. +# Without this a necessary output (e.g. libluv.a) might not be updated/installed. +# +message(STATUS "extracting... [clean binary dir]") +file(REMOVE_RECURSE ${BINARY_DIR}) +file(MAKE_DIRECTORY ${BINARY_DIR}) + # Clean up: # message(STATUS "extracting... [clean up]") |