Skip to content

Conversation

ligurio
Copy link
Owner

@ligurio ligurio commented Nov 29, 2024

@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch 2 times, most recently from 707e817 to ba5854f Compare November 30, 2024 10:31
@ligurio ligurio marked this pull request as draft November 30, 2024 13:41
@ligurio ligurio closed this Dec 2, 2024
@ligurio ligurio reopened this Dec 2, 2024
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch 2 times, most recently from 1faefd7 to c64eecc Compare December 2, 2024 10:52
@ligurio ligurio marked this pull request as ready for review December 2, 2024 16:15
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch 2 times, most recently from 97230cc to a8cf3a6 Compare December 9, 2024 14:03
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch 9 times, most recently from 064d466 to 66a4174 Compare December 18, 2024 17:08
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch 2 times, most recently from 983eae2 to b5bccc4 Compare January 22, 2025 19:26
The arguments to `else()` and `endif()` were required before
version 2.6.0. As of CMake 2.6.0 the `else()` and `endif()`
constructs can be empty. The same is true for closing constructs
on `endmacro()`, `endfunction()`, and `endforeach()`. If you
require 2.4.x compatibility, CMake 2.4.3 or greater recognizes the
`CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS` option (which is superfluous
in 2.6.0). See [1] and [2].

The patch removes arguments in `endif()`.

1. https://cmake.org/cmake/help/v3.6/command/endif.html
2. https://stackoverflow.com/questions/29959126/why-does-cmake-syntax-have-redundant-parentheses-everywhere/29967305#29967305
Required for setting a Lua library outside.
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch 3 times, most recently from 7c7a3cf to fa9b78c Compare January 23, 2025 10:54
The patch introduce a CMake flag `IS_LUAJIT` that should be
enabled when passed `LUA_LIBRARIES` and `LUA_INCLUDE_DIR` point to
a LuaJIT implementation.

Required for setting a Lua library outside.
Building a project as ExternalProject in Tarantool is failed
because initial LDFLAGS is empty and after adding an option
a final value has a leading whitespace, but should not [1]:

CMake Error at tests/capi/CMakeLists.txt:69 (add_executable):
  Target "ffi_cdef_proto_test" links to item " -g" which has leading or
  trailing whitespace.  This is now an error according to policy CMP0004.
Call Stack (most recent call first):
  tests/capi/ffi_cdef_proto/CMakeLists.txt:16 (create_test)

The patch add a macro `AppendFlags` that allow to avoid such
issues.

Needed by tarantool/tarantool#10911

1. https://cmake.org/cmake/help/latest/policy/CMP0004.html
The project builds Lua libraries for two the most popular Lua
implementations: PUC Rio Lua and LuaJIT. However, integration with
other implementations are interesting as well (like Tarantool,
LuaVela, OpenResty etc.). The patch enables integration with other
Lua libraries by setting `LUA_INCLUDE_DIR`, `LUA_LIBRARIES` and
`LUA_EXECUTABLE` (yes, it is required too).

Needed for tarantool/tarantool#10911
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch from fa9b78c to 1a7a167 Compare January 23, 2025 10:57
@ligurio ligurio merged commit 40d0d82 into master Jan 23, 2025
11 checks passed
@ligurio ligurio deleted the ligurio/gh-xxxx-set-liblua-outside branch January 23, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant