Skip to content

Commit 222e67f

Browse files
drelaptopminggo
authored andcommitted
modern cmake, set needed target macro define (#329)
* add "LWS_WITH_LIBUV" define into websockets cmake files * add _GNU_SOURCE into luasockets target
1 parent 445a001 commit 222e67f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lua/luasocket/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ add_library(${target_name} STATIC
3838
${${target_name}_src}
3939
)
4040

41+
if(LINUX)
42+
target_compile_definitions(${target_name} PRIVATE _GNU_SOURCE)
43+
endif()
44+
4145
target_include_directories(${target_name}
4246
INTERFACE ..
4347
PRIVATE ../lua

websockets/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ include(../cmake/CocosExternalConfig.cmake)
99

1010
add_library(${target_name} STATIC IMPORTED GLOBAL)
1111

12-
# include libs depended
13-
# add_subdirectory(../openssl ${CMAKE_BINARY_DIR}/websockets/openssl)
14-
# add_subdirectory(../uv ${CMAKE_BINARY_DIR}/websockets/uv)
15-
1612
set_target_properties(${target_name} PROPERTIES
1713
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/${platform_name}"
1814
)
15+
set_target_properties(${target_name} PROPERTIES
16+
INTERFACE_COMPILE_DEFINITIONS "LWS_WITH_LIBUV"
17+
)
18+
1919
set_property(TARGET ${target_name} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ext_ssl")
2020
set_property(TARGET ${target_name} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ext_crypto")
2121
set_property(TARGET ${target_name} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ext_uv")

0 commit comments

Comments
 (0)