diff options
author | Mark Pulford <mark@kyne.com.au> | 2012-01-04 08:34:13 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2012-03-04 18:54:34 +1030 |
commit | 3871cb71c858b8e542b78677f782b88ddd820cb3 (patch) | |
tree | 4d501e21d3778b6b954a381304d0532f90845b56 /CMakeLists.txt | |
parent | f978573e06e2074ef550b0360f27f51166311d1d (diff) | |
download | lua-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.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}) |