Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: allow to set a Lua library outside #113

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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 from c64eecc to 97230cc Compare December 9, 2024 09:43
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.
Required for setting a Lua library outside.
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch from 97230cc to a8cf3a6 Compare December 9, 2024 14:03
@ligurio ligurio force-pushed the ligurio/gh-xxxx-set-liblua-outside branch 8 times, most recently from ea5bac5 to 064d466 Compare December 18, 2024 15:54
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 064d466 to 66a4174 Compare December 18, 2024 17:08
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