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

src/CMakeLists.txt: fix TERMIT_CFLAGS #131

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Conversation

Rongronggg9
Copy link
Contributor

@Rongronggg9 Rongronggg9 commented Oct 17, 2022

LUA_INCLUDE_DIR is incorrect, the correct one is LUA_INCLUDEDIR. Thus, "-I${LUA_INCLUDE_DIR}" will become "-I", suppressing the following argument. However, it can be simply dropped as d9731f1 has already included LUA_CFLAGS in TERMIT_CFLAGS.

Close #125

Built successfully on Arch Linux (mips64r6el, QEMU user) (previously failed): https://oss.cipunited.com/ci/job/ciBuilds/job/termit/42/execution/node/57/log/

Also built successfully on Arch Linux and Debian sid (both x86_64) in my local tests.

Detailed analysis here: #125 (comment)

`LUA_INCLUDE_DIR` is incorrect, the correct one is `LUA_INCLUDEDIR`.
Thus, "-I${LUA_INCLUDE_DIR}" will become "-I", suppressing the following
argument. However, it can be simply dropped as d9731f1 has already
included `LUA_CFLAGS` in `TERMIT_CFLAGS`.
@nonstop
Copy link
Owner

nonstop commented Oct 27, 2022

Thanks a lot

@nonstop nonstop closed this Oct 27, 2022
@Rongronggg9
Copy link
Contributor Author

Rongronggg9 commented Oct 27, 2022

Sorry for disturbing you, @nonstop. Why was the PR closed? Did I make any mistakes?

SET(LUA_VERSION "" CACHE STRING "Lua version")
IF(LUA_VERSION STREQUAL "")
IF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
pkg_search_module(LUA REQUIRED lua53)
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
ELSE(LUA_VERSION STREQUAL "")
pkg_search_module(LUA REQUIRED
lua=${LUA_VERSION} lua5.3=${LUA_VERSION})
ENDIF(LUA_VERSION STREQUAL "")
IF(NOT LUA_FOUND)
message(FATAL_ERROR "Lua library was not found.")
ENDIF(NOT LUA_FOUND)

The method used to find Lua is pkg_check_modules which belongs to the module FindPkgConfig. According to https://cmake.org/cmake/help/v3.24/module/FindPkgConfig.html, LUA_INCLUDE_DIR is incorrect, but LUA_INCLUDEDIR.

LUA_INCLUDE_DIR is correct only if the method used to find Lua is find_package(LUA) belonging to module FindLua, but the reality is the opposite.


The reason why I simply dropped the whole flag is that LUA_CFLAGS is already here (it always includes -I${LUA_INCLUDEDIR} if needed):

FOREACH(cflag ${VTE_CFLAGS} ${GTK_CFLAGS} ${LUA_CFLAGS})

And what's more, according to my analysis here, due to the "coincidence" on Debian, -I -pthread becomes a useless flag, de facto the same as dropping them completely.

@nonstop
Copy link
Owner

nonstop commented Oct 27, 2022

I thought I merged your pull request.

@nonstop nonstop reopened this Oct 27, 2022
@nonstop nonstop merged commit 0ae773f into nonstop:master Oct 27, 2022
@nonstop
Copy link
Owner

nonstop commented Oct 27, 2022

Oh, yeah!

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.

trouble with vte.h
2 participants