diff options
author | Ronan Collobert <locronan@fb.com> | 2017-04-19 08:31:03 +0300 |
---|---|---|
committer | Ronan Collobert <locronan@fb.com> | 2017-04-19 08:31:03 +0300 |
commit | ac9cf106d55f3c2441064d79162b1cb9a8b29189 (patch) | |
tree | c31a187bb5460695f0be2dbbc770df805ce1bc8b /CMakeLists.txt | |
parent | d371549d4532a77beb935e20540d2ecbb72d0a8f (diff) |
luaL_setfuncs detection more robust
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e39a8e..c90fc76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,20 @@ set(luasrc safe.lua ) +set(CMAKE_REQUIRED_INCLUDES ${LUA_INCDIR}) +include(CheckCSourceCompiles) +check_c_source_compiles(" +#include <lauxlib.h> +int main() +{ + long i = sizeof(&luaL_setfuncs); + return 0; +} +" HAS_LUAL_SETFUNCS) +if(HAS_LUAL_SETFUNCS) + add_definitions(-DHAS_LUAL_SETFUNCS) +endif() + ADD_LIBRARY(threadsmain MODULE lib/thread-main.c) IF(APPLE) SET_TARGET_PROPERTIES(threadsmain PROPERTIES |