summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2012-01-04 08:34:13 +1030
committerMark Pulford <mark@kyne.com.au>2012-03-04 18:54:34 +1030
commit3871cb71c858b8e542b78677f782b88ddd820cb3 (patch)
tree4d501e21d3778b6b954a381304d0532f90845b56 /CMakeLists.txt
parentf978573e06e2074ef550b0360f27f51166311d1d (diff)
downloadlua-cjson-3871cb71c858b8e542b78677f782b88ddd820cb3.tar.gz
lua-cjson-3871cb71c858b8e542b78677f782b88ddd820cb3.tar.bz2
lua-cjson-3871cb71c858b8e542b78677f782b88ddd820cb3.zip
Use DISABLE_INVALID_NUMBERS on WIN32 CMake builds
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
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)
52endif() 52endif()
53 53
54set(_MODULE_LINK "${CMAKE_THREAD_LIBS_INIT}")
55get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH)
56
54if(APPLE) 57if(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")
57endif() 60endif()
58 61
59get_filename_component(_lua_lib_dir ${LUA_LIBRARY} PATH)
60if(WIN32) 62if(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)
62else() 68else()
63 set(_lua_module_dir "${_lua_lib_dir}/lua/5.1") 69 set(_lua_module_dir "${_lua_lib_dir}/lua/5.1")
64endif() 70endif()
65 71
66set(_MODULE_LINK "${CMAKE_THREAD_LIBS_INIT}")
67if(WIN32)
68 # Win32 modules need to be linked to the Lua library.
69 set(_MODULE_LINK ${LUA_LIBRARY} ${_MODULE_LINK})
70endif()
71
72add_library(cjson MODULE lua_cjson.c strbuf.c ${FPCONV_SOURCES}) 72add_library(cjson MODULE lua_cjson.c strbuf.c ${FPCONV_SOURCES})
73set_target_properties(cjson PROPERTIES PREFIX "") 73set_target_properties(cjson PROPERTIES PREFIX "")
74target_link_libraries(cjson ${_MODULE_LINK}) 74target_link_libraries(cjson ${_MODULE_LINK})