-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[lua] Export cmake targets, rewrite CMakeLists and delete usage #15921
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
547e40e
[lua] Export cmake targets, rewrite CMakeLists and delete usage
e6ce523
update version record
f08303f
[lua] Restore usage, provides LUA_INCLUDE_DIR
728eae2
update version record
10ea3af
Merge branch 'master' into dev/jack/15497
JackBoosY 72a1401
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
668039c
Cleanup codes
ca8e22f
Re-factory wrapper
b6261e9
Clean the warning message
2bbb18a
version
6ae50a9
Fixup tools, fix version string.
a748cd8
version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| Use this package via the module FindLua that comes with CMake. To use in your CMakeLists.txt: | ||
|
|
||
| include(FindLua) | ||
| find_package(Lua REQUIRED) | ||
| target_link_libraries(main PRIVATE ${LUA_LIBRARIES}) | ||
| target_include_directories(main PRIVATE ${LUA_INCLUDE_DIR}) | ||
|
|
||
| For more information about the variables set by this module, please see: | ||
| https://cmake.org/cmake/help/latest/module/FindLua.html | ||
| target_link_libraries(main PRIVATE ${LUA_LIBRARIES}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,23 @@ | ||
| _find_package(${ARGS}) | ||
| set(REQUIRES ) | ||
| foreach(ARG IN_LISTS ${ARGS}) | ||
| if (ARG STREQUAL "REQUIRED") | ||
| set(REQUIRES "REQUIRED") | ||
| endif() | ||
| endforeach() | ||
|
|
||
| _find_package(unofficial-lua CONFIG ${REQUIRES}) | ||
|
|
||
| if (@ENABLE_LUA_CPP@) | ||
| find_library(lua_cpp NAMES lua-c++ liblua-c++ REQUIRED) | ||
| set(LUA_LIBRARIES ${LUA_LIBRARIES} ${lua_cpp}) | ||
| endif() | ||
| _find_package(unofficial-lua-cpp CONFIG ${REQUIRES}) | ||
| endif() | ||
|
|
||
| get_filename_component(LUA_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH) | ||
| get_filename_component(LUA_INCLUDE_DIR "${LUA_INCLUDE_DIR}" PATH) | ||
| set(LUA_INCLUDE_DIR ${LUA_INCLUDE_DIR}/include) | ||
|
|
||
| list(APPEND LUA_LIBRARIES lua) | ||
| if (TARGET lua-cpp) | ||
| list(APPEND LUA_LIBRARIES lua-cpp) | ||
| endif() | ||
|
|
||
| set(LUA_FOUND 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.