From 10860164778327c0009f6efc8e020308cadb13a2 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sat, 13 May 2023 12:12:29 +0200 Subject: 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 --- cmake/FindLuv.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cmake/FindLuv.cmake (limited to 'cmake/FindLuv.cmake') diff --git a/cmake/FindLuv.cmake b/cmake/FindLuv.cmake new file mode 100644 index 0000000000..ebd74887ed --- /dev/null +++ b/cmake/FindLuv.cmake @@ -0,0 +1,14 @@ +find_path(LUV_INCLUDE_DIR luv/luv.h) +find_library(LUV_LIBRARY NAMES luv_a luv libluv_a) + +# Ubuntu-specific workaround to find system paths +function(ubuntu) + set(CMAKE_FIND_LIBRARY_PREFIXES "") + find_path(LUV_INCLUDE_DIR luv/luv.h PATH_SUFFIXES lua5.1) + find_library(LUV_LIBRARY NAMES luv PATH_SUFFIXES lua/5.1) +endfunction() +ubuntu() + +find_package_handle_standard_args(Luv DEFAULT_MSG + LUV_LIBRARY LUV_INCLUDE_DIR) +mark_as_advanced(LUV_INCLUDE_DIR LUV_LIBRARY) -- cgit From c50951a4d0cf480aa138a2ed2bd2deedebeb0dec Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 4 Sep 2023 00:00:26 +0200 Subject: build: various fixes - simplify lua interpreter search - fix incorrect variable name in BuildLua.cmake - build PUC Lua with -O2 - silence non-mandatory find_package search for libuv - simplify Find modules - Prefer using the explicitly set CI_BUILD over relying on the environment variable "CI". --- cmake/FindLuv.cmake | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'cmake/FindLuv.cmake') diff --git a/cmake/FindLuv.cmake b/cmake/FindLuv.cmake index ebd74887ed..7544859ceb 100644 --- a/cmake/FindLuv.cmake +++ b/cmake/FindLuv.cmake @@ -1,13 +1,5 @@ -find_path(LUV_INCLUDE_DIR luv/luv.h) -find_library(LUV_LIBRARY NAMES luv_a luv libluv_a) - -# Ubuntu-specific workaround to find system paths -function(ubuntu) - set(CMAKE_FIND_LIBRARY_PREFIXES "") - find_path(LUV_INCLUDE_DIR luv/luv.h PATH_SUFFIXES lua5.1) - find_library(LUV_LIBRARY NAMES luv PATH_SUFFIXES lua/5.1) -endfunction() -ubuntu() +find_path(LUV_INCLUDE_DIR luv/luv.h PATH_SUFFIXES lua5.1) +find_library(LUV_LIBRARY NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lua/5.1) find_package_handle_standard_args(Luv DEFAULT_MSG LUV_LIBRARY LUV_INCLUDE_DIR) -- cgit From b80a8e2c16b6d6eb16ac84232c27eb7cfa4a434a Mon Sep 17 00:00:00 2001 From: dundargoc Date: Tue, 10 Oct 2023 23:18:45 +0200 Subject: build: adjust how find order is prioritized Ensure bundled libraries and include directories are always searched first before any others. This will provide a more consistent experience as the search order of the builtin find_ functions can vary depending on system. This should make the build process faster when building with bundled deps as we limit the search to only the .deps directory. Separating the search between .deps and everything makes debugging find_-related problems simpler if you need to check how dependencies are found. For libraries, we divide the search process into the following order: 1. Only search in .deps directory and only search for static libraries. 2. Only search in .deps directory and search for all libraries. 3. Search everywhere and search for all libraries. Make an exception for FindLibintl.cmake as changing the search order seems to break some tests on macos. --- cmake/FindLuv.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmake/FindLuv.cmake') diff --git a/cmake/FindLuv.cmake b/cmake/FindLuv.cmake index 7544859ceb..a4408fe659 100644 --- a/cmake/FindLuv.cmake +++ b/cmake/FindLuv.cmake @@ -1,5 +1,5 @@ -find_path(LUV_INCLUDE_DIR luv/luv.h PATH_SUFFIXES lua5.1) -find_library(LUV_LIBRARY NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lua/5.1) +find_path2(LUV_INCLUDE_DIR luv/luv.h PATH_SUFFIXES lua5.1) +find_library2(LUV_LIBRARY NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lua/5.1) find_package_handle_standard_args(Luv DEFAULT_MSG LUV_LIBRARY LUV_INCLUDE_DIR) -- cgit