Skip to content

Commit

Permalink
[lua] Fix compiler error of lua[tools] (microsoft#29897)
Browse files Browse the repository at this point in the history
* Fix linux tools can't compile with undefined reference to `sin'

* update port version

* update baseline.json

* fix duplicate FIND_LIBRARY (LIB_MATH NAMES m) & fix linking of luac is missing math libs

* update lua port version in version database

---------

Co-authored-by: tobias.funk <[email protected]>
  • Loading branch information
TobiasFunk and tobias.funk authored Mar 1, 2023
1 parent 6aa4fca commit b41bc7c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ports/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ENDIF ()

IF (UNIX)
ADD_DEFINITIONS (-DLUA_USE_POSIX)
FIND_LIBRARY (LIB_MATH NAMES m)
ENDIF ()

# C library
Expand All @@ -51,7 +52,6 @@ IF (UNIX)
TARGET_COMPILE_DEFINITIONS (lua PUBLIC -DLUA_USE_DLOPEN)
TARGET_LINK_LIBRARIES (lua ${CMAKE_DL_LIBS})
ENDIF ()
FIND_LIBRARY (LIB_MATH NAMES m)
IF (LIB_MATH)
TARGET_LINK_LIBRARIES (lua m)
ENDIF ()
Expand Down Expand Up @@ -94,6 +94,10 @@ IF (INSTALL_TOOLS)
TARGET_INCLUDE_DIRECTORIES (luai PUBLIC /usr/include/edit)
ENDIF ()
ENDIF ()

IF (LIB_MATH)
TARGET_LINK_LIBRARIES (luac m)
ENDIF ()
ENDIF ()
INSTALL ( TARGETS luai luac RUNTIME DESTINATION tools/lua )
ENDIF ()
Expand Down
2 changes: 1 addition & 1 deletion ports/lua/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lua",
"version": "5.4.4",
"port-version": 4,
"port-version": 5,
"description": "A powerful, fast, lightweight, embeddable scripting language",
"homepage": "https://www.lua.org",
"license": null,
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4798,7 +4798,7 @@
},
"lua": {
"baseline": "5.4.4",
"port-version": 4
"port-version": 5
},
"lua-compat53": {
"baseline": "0.10",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/lua.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0a579d274fbb147e35fc45578cc446cad2c76079",
"version": "5.4.4",
"port-version": 5
},
{
"git-tree": "8c9fa7041bab78ab01bc8774e6f7dcc46439a978",
"version": "5.4.4",
Expand Down

0 comments on commit b41bc7c

Please sign in to comment.