2023-01-20 15:48:46 -07:00
|
|
|
set(LUV_CMAKE_ARGS
|
2023-02-08 03:00:16 -07:00
|
|
|
-D LUA_BUILD_TYPE=System
|
|
|
|
-D LUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3
|
|
|
|
-D WITH_SHARED_LIBUV=ON
|
|
|
|
-D BUILD_STATIC_LIBS=ON
|
|
|
|
-D BUILD_MODULE=OFF)
|
2016-04-10 19:49:23 -07:00
|
|
|
|
2019-07-09 12:55:01 -07:00
|
|
|
if(USE_BUNDLED_LUAJIT)
|
2023-02-08 03:00:16 -07:00
|
|
|
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
|
2019-07-09 12:55:01 -07:00
|
|
|
elseif(USE_BUNDLED_LUA)
|
2023-02-08 03:00:16 -07:00
|
|
|
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
|
2019-07-09 12:55:01 -07:00
|
|
|
else()
|
2023-03-02 14:50:43 -07:00
|
|
|
find_package(Luajit)
|
2019-07-09 12:55:01 -07:00
|
|
|
if(LUAJIT_FOUND)
|
2023-02-08 03:00:16 -07:00
|
|
|
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
|
2019-07-09 12:55:01 -07:00
|
|
|
else()
|
2023-02-08 03:00:16 -07:00
|
|
|
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
|
2019-07-09 12:55:01 -07:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2018-05-27 02:16:29 -07:00
|
|
|
if(USE_BUNDLED_LIBUV)
|
2023-03-02 14:50:43 -07:00
|
|
|
list(APPEND LUV_CMAKE_ARGS -D CMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR})
|
2018-05-27 02:16:29 -07:00
|
|
|
endif()
|
|
|
|
|
2023-04-20 04:19:38 -07:00
|
|
|
list(APPEND LUV_CMAKE_ARGS "-DCMAKE_C_FLAGS:STRING=${DEPS_INCLUDE_FLAGS}")
|
2023-01-22 10:02:02 -07:00
|
|
|
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
|
|
|
|
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
|
2023-02-08 03:00:16 -07:00
|
|
|
list(APPEND LUV_CMAKE_ARGS -D CMAKE_MAKE_PROGRAM=gmake)
|
2016-04-10 19:49:23 -07:00
|
|
|
endif()
|
|
|
|
|
2022-08-29 07:57:46 -07:00
|
|
|
ExternalProject_Add(lua-compat-5.3
|
|
|
|
URL ${LUA_COMPAT53_URL}
|
2022-09-29 12:46:14 -07:00
|
|
|
URL_HASH SHA256=${LUA_COMPAT53_SHA256}
|
|
|
|
DOWNLOAD_NO_PROGRESS TRUE
|
2022-08-29 07:57:46 -07:00
|
|
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
INSTALL_COMMAND "")
|
2016-04-10 19:49:23 -07:00
|
|
|
|
2023-05-13 03:12:29 -07:00
|
|
|
ExternalProject_Add(luv
|
2022-08-29 07:57:46 -07:00
|
|
|
DEPENDS lua-compat-5.3
|
|
|
|
URL ${LUV_URL}
|
2022-09-29 12:46:14 -07:00
|
|
|
URL_HASH SHA256=${LUV_SHA256}
|
|
|
|
DOWNLOAD_NO_PROGRESS TRUE
|
2022-08-29 07:57:46 -07:00
|
|
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv
|
2022-09-29 12:46:14 -07:00
|
|
|
SOURCE_DIR ${DEPS_BUILD_DIR}/src/luv
|
2023-01-25 06:36:17 -07:00
|
|
|
CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${LUV_CMAKE_ARGS}
|
|
|
|
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
2016-04-10 19:49:23 -07:00
|
|
|
|
2017-03-25 16:22:15 -07:00
|
|
|
if(USE_BUNDLED_LUAJIT)
|
2023-05-13 03:12:29 -07:00
|
|
|
add_dependencies(luv luajit)
|
2022-08-12 08:59:40 -07:00
|
|
|
elseif(USE_BUNDLED_LUA)
|
2023-05-13 03:12:29 -07:00
|
|
|
add_dependencies(luv lua)
|
2017-03-25 16:22:15 -07:00
|
|
|
endif()
|
|
|
|
if(USE_BUNDLED_LIBUV)
|
2023-05-13 03:12:29 -07:00
|
|
|
add_dependencies(luv libuv)
|
2017-03-25 16:22:15 -07:00
|
|
|
endif()
|