mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 09:28:59 +08:00
1045e88e42
* [lua] support iOS triplets * separate interpreter/compiler to lua[tools] feature * update git-tree SHA * [lua] revert feature separation * [lua] update port SHA * [lua] make 'tools' default-feature * set `ENABLE_LUA_CPP` for cmake wrapper * [lua] fix after collision * Update ports/lua/portfile.cmake Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * Update ports/lua/portfile.cmake Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * [lua] import TargetConditionals for apple platform * Update ports/lua/vcpkg.json Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * Update ports/lua/portfile.cmake Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * [lua] remove negations for 'tool' config use FEATURES instread of INVERTED_FEATURES to prevent confusions Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
30 lines
744 B
Diff
30 lines
744 B
Diff
diff --git a/src/loslib.c b/src/loslib.c
|
|
index e65e188..3595601 100644
|
|
--- a/src/loslib.c
|
|
+++ b/src/loslib.c
|
|
@@ -3,7 +3,9 @@
|
|
** Standard Operating System library
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
-
|
|
+#if defined(__APPLE__)
|
|
+#include <TargetConditionals.h>
|
|
+#endif
|
|
#define loslib_c
|
|
#define LUA_LIB
|
|
|
|
@@ -143,7 +145,12 @@ static int os_execute (lua_State *L) {
|
|
const char *cmd = luaL_optstring(L, 1, NULL);
|
|
int stat;
|
|
errno = 0;
|
|
- stat = system(cmd);
|
|
+#if defined(__APPLE__) && !TARGET_OS_OSX
|
|
+ // system() is __IOS_PROHIBITED, __WATCHOS_PROHIBITED, and __TVOS_PROHIBITED.
|
|
+ stat = 127; // error: shell execution failed
|
|
+#else
|
|
+ stat = system(cmd);
|
|
+#endif
|
|
if (cmd != NULL)
|
|
return luaL_execresult(L, stat);
|
|
else {
|