build: fix luacheck detection (avoids re-download on win32) (#7905)

This commit is contained in:
George Zhao 2018-01-24 17:29:30 +08:00 committed by Justin M. Keyes
parent 15119f943a
commit a3daa8cb13

View File

@ -136,8 +136,10 @@ if(USE_BUNDLED_BUSTED)
if(WIN32) if(WIN32)
set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted.bat") set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted.bat")
set(LUACHECK_EXE "${HOSTDEPS_BIN_DIR}/luacheck.bat")
else() else()
set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted") set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted")
set(LUACHECK_EXE "${HOSTDEPS_BIN_DIR}/luacheck")
endif() endif()
# DEPENDS on the previous module, because Luarocks breaks if parallel. # DEPENDS on the previous module, because Luarocks breaks if parallel.
add_custom_command(OUTPUT ${BUSTED_EXE} add_custom_command(OUTPUT ${BUSTED_EXE}
@ -148,12 +150,12 @@ if(USE_BUNDLED_BUSTED)
DEPENDS ${BUSTED_EXE}) DEPENDS ${BUSTED_EXE})
# DEPENDS on the previous module, because Luarocks breaks if parallel. # DEPENDS on the previous module, because Luarocks breaks if parallel.
add_custom_command(OUTPUT ${HOSTDEPS_BIN_DIR}/luacheck add_custom_command(OUTPUT ${LUACHECK_EXE}
COMMAND ${LUAROCKS_BINARY} COMMAND ${LUAROCKS_BINARY}
ARGS build https://raw.githubusercontent.com/mpeterv/luacheck/master/luacheck-scm-1.rockspec ${LUAROCKS_BUILDARGS} ARGS build https://raw.githubusercontent.com/mpeterv/luacheck/master/luacheck-scm-1.rockspec ${LUAROCKS_BUILDARGS}
DEPENDS busted) DEPENDS busted)
add_custom_target(luacheck add_custom_target(luacheck
DEPENDS ${HOSTDEPS_BIN_DIR}/luacheck) DEPENDS ${LUACHECK_EXE})
set(LUV_DEPS luacheck luv-static) set(LUV_DEPS luacheck luv-static)
if(MINGW AND CMAKE_CROSSCOMPILING) if(MINGW AND CMAKE_CROSSCOMPILING)