diff options
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f3e970..18d6b97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -51,24 +51,24 @@ if(NOT HAVE_ISINF) | |||
51 | add_definitions(-DUSE_INTERNAL_ISINF) | 51 | add_definitions(-DUSE_INTERNAL_ISINF) |
52 | endif() | 52 | endif() |
53 | 53 | ||
54 | set(_MODULE_LINK "${CMAKE_THREAD_LIBS_INIT}") | ||
55 | get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH) | ||
56 | |||
54 | if(APPLE) | 57 | if(APPLE) |
55 | set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS | 58 | set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS |
56 | "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup") | 59 | "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup") |
57 | endif() | 60 | endif() |
58 | 61 | ||
59 | get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH) | ||
60 | if(WIN32) | 62 | if(WIN32) |
63 | # Win32 modules need to be linked to the Lua library. | ||
64 | set(_MODULE_LINK ${LUA_LIBRARY} ${_MODULE_LINK}) | ||
61 | set(_lua_module_dir "${_lua_lib_dir}") | 65 | set(_lua_module_dir "${_lua_lib_dir}") |
66 | # Windows sprintf()/strtod() handle NaN/inf differently. Not supported. | ||
67 | add_definitions(-DDISABLE_INVALID_NUMBERS) | ||
62 | else() | 68 | else() |
63 | set(_lua_module_dir "${_lua_lib_dir}/lua/5.1") | 69 | set(_lua_module_dir "${_lua_lib_dir}/lua/5.1") |
64 | endif() | 70 | endif() |
65 | 71 | ||
66 | set(_MODULE_LINK "${CMAKE_THREAD_LIBS_INIT}") | ||
67 | if(WIN32) | ||
68 | # Win32 modules need to be linked to the Lua library. | ||
69 | set(_MODULE_LINK ${LUA_LIBRARY} ${_MODULE_LINK}) | ||
70 | endif() | ||
71 | |||
72 | add_library(cjson MODULE lua_cjson.c strbuf.c ${FPCONV_SOURCES}) | 72 | add_library(cjson MODULE lua_cjson.c strbuf.c ${FPCONV_SOURCES}) |
73 | set_target_properties(cjson PROPERTIES PREFIX "") | 73 | set_target_properties(cjson PROPERTIES PREFIX "") |
74 | target_link_libraries(cjson ${_MODULE_LINK}) | 74 | target_link_libraries(cjson ${_MODULE_LINK}) |