diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-05-13 12:12:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 12:12:29 +0200 |
commit | 10860164778327c0009f6efc8e020308cadb13a2 (patch) | |
tree | 735513c4c2943080f5e554e8699f623fe6ecea06 /cmake.deps/cmake | |
parent | ed8c44f76762061e30cb8056483f55d38802eaef (diff) | |
download | rneovim-10860164778327c0009f6efc8e020308cadb13a2.tar.gz rneovim-10860164778327c0009f6efc8e020308cadb13a2.tar.bz2 rneovim-10860164778327c0009f6efc8e020308cadb13a2.zip |
build: cmake cleanup
- Simplify error checking when using execute_process.
- Set BUILD_SHARED_LIBS to OFF when building dependencies.
This is normally not needed, but msgpack interprets an unset
BUILD_SHARED_LIBS to build a shared library, which is the opposite of
the cmake behavior.
- Move function check_lua_module to Util.cmake.
- Remove unnecessary code.
- Make variable naming more consistent
Diffstat (limited to 'cmake.deps/cmake')
-rw-r--r-- | cmake.deps/cmake/BuildLuarocks.cmake | 6 | ||||
-rw-r--r-- | cmake.deps/cmake/BuildLuv.cmake | 9 | ||||
-rw-r--r-- | cmake.deps/cmake/BuildMsgpack.cmake | 8 | ||||
-rw-r--r-- | cmake.deps/cmake/CopyFilesGlob.cmake | 2 |
4 files changed, 8 insertions, 17 deletions
diff --git a/cmake.deps/cmake/BuildLuarocks.cmake b/cmake.deps/cmake/BuildLuarocks.cmake index d45776f5b1..5725507c36 100644 --- a/cmake.deps/cmake/BuildLuarocks.cmake +++ b/cmake.deps/cmake/BuildLuarocks.cmake @@ -1,4 +1,4 @@ -# Luarocks recipe. Luarocks is only required when building Neovim. +# Luarocks recipe. Luarocks is only required when testing Neovim. # NOTE: LuaRocks rocks need to "DEPENDS" on the previous module, because # running luarocks in parallel will break, e.g. when some rocks have # the same dependency. @@ -31,7 +31,7 @@ if(UNIX) find_package(Luajit) if(LUAJIT_FOUND) list(APPEND LUAROCKS_OPTS - --with-lua-include=${LUAJIT_INCLUDE_DIRS} + --with-lua-include=${LUAJIT_INCLUDE_DIR} --with-lua-interpreter=luajit) endif() @@ -46,7 +46,7 @@ if(UNIX) OUTPUT_VARIABLE LUA_VERSION ERROR_VARIABLE ERR RESULT_VARIABLE RES) - if(NOT RES EQUAL 0) + if(RES) message(FATAL_ERROR "Could not get LUA_VERSION with ${LUA_EXE}: ${ERR}") endif() endif() diff --git a/cmake.deps/cmake/BuildLuv.cmake b/cmake.deps/cmake/BuildLuv.cmake index 08168c9804..7220333de1 100644 --- a/cmake.deps/cmake/BuildLuv.cmake +++ b/cmake.deps/cmake/BuildLuv.cmake @@ -2,7 +2,6 @@ set(LUV_CMAKE_ARGS -D LUA_BUILD_TYPE=System -D LUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3 -D WITH_SHARED_LIBUV=ON - -D BUILD_SHARED_LIBS=OFF -D BUILD_STATIC_LIBS=ON -D BUILD_MODULE=OFF) @@ -38,7 +37,7 @@ ExternalProject_Add(lua-compat-5.3 BUILD_COMMAND "" INSTALL_COMMAND "") -ExternalProject_Add(luv-static +ExternalProject_Add(luv DEPENDS lua-compat-5.3 URL ${LUV_URL} URL_HASH SHA256=${LUV_SHA256} @@ -49,10 +48,10 @@ ExternalProject_Add(luv-static CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) if(USE_BUNDLED_LUAJIT) - add_dependencies(luv-static luajit) + add_dependencies(luv luajit) elseif(USE_BUNDLED_LUA) - add_dependencies(luv-static lua) + add_dependencies(luv lua) endif() if(USE_BUNDLED_LIBUV) - add_dependencies(luv-static libuv) + add_dependencies(luv libuv) endif() diff --git a/cmake.deps/cmake/BuildMsgpack.cmake b/cmake.deps/cmake/BuildMsgpack.cmake index c9033be1ae..f63559e6b4 100644 --- a/cmake.deps/cmake/BuildMsgpack.cmake +++ b/cmake.deps/cmake/BuildMsgpack.cmake @@ -7,11 +7,3 @@ ExternalProject_Add(msgpack -D MSGPACK_BUILD_TESTS=OFF -D MSGPACK_BUILD_EXAMPLES=OFF CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS}) - -if (NOT MSVC) - add_custom_target(clean_shared_libraries_msgpack ALL - COMMAND ${CMAKE_COMMAND} - -D REMOVE_FILE_GLOB=${DEPS_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}* - -P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake) - add_dependencies(clean_shared_libraries_msgpack msgpack) -endif() diff --git a/cmake.deps/cmake/CopyFilesGlob.cmake b/cmake.deps/cmake/CopyFilesGlob.cmake index 8950ead1e5..7d0f4fc289 100644 --- a/cmake.deps/cmake/CopyFilesGlob.cmake +++ b/cmake.deps/cmake/CopyFilesGlob.cmake @@ -14,7 +14,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TO}) file(GLOB files ${FROM_GLOB}) foreach(file ${files}) execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${file} ${TO} RESULT_VARIABLE rv) - if(NOT rv EQUAL 0) + if(rv) message(FATAL_ERROR "Error copying ${file}") endif() endforeach() |