Enable LUA_USE_POSIX if possible in bundled Lua
authorest31 <MTest31@outlook.com>
Thu, 12 Feb 2015 06:13:14 +0000 (16:13 +1000)
committerCraig Robbins <kde.psych@gmail.com>
Thu, 12 Feb 2015 06:14:12 +0000 (16:14 +1000)
Fixes warning:
src/lua/src/loslib.c:60: Warning: the use of `tmpnam' is dangerous, better use `mkstemp'

src/lua/CMakeLists.txt

index 36e27188947dd433021c1e9fac9398b30245f9c4..4bfe318eede19f12316b7f27e06aed55496ba03c 100644 (file)
@@ -47,10 +47,6 @@ else()
 endif()
 mark_as_advanced(LUA_USE_DLOPEN)
 
-if(DEFAULT_POSIX)
-else()
-endif()
-
 if(DEFAULT_ANSI)
        option(LUA_ANSI "Disable non-ansi features." ON)
 else()
@@ -87,6 +83,10 @@ if(LUA_USE_DLOPEN)
        endif(NOT APPLE)
 endif(LUA_USE_DLOPEN)
 
+if(DEFAULT_POSIX)
+       set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_USE_POSIX")
+endif(DEFAULT_POSIX)
+
 if(LUA_ANSI)
        set(COMMON_CFLAGS "${COMMON_CFLAGS} -DLUA_ANSI")
 endif(LUA_ANSI)