mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
cmakelists: clean out pthreads and normalize libmount args
This commit is contained in:
parent
16cbbe2b40
commit
425da070e3
2 changed files with 23 additions and 28 deletions
|
@ -31,11 +31,17 @@ include(CheckLibraryExists)
|
|||
include(CheckTypeSize)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
if(POLICY CMP0048)
|
||||
if (POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
endif()
|
||||
|
||||
#cmake_policy(SET CMP0076 NEW)
|
||||
#if (POLICY CMP0024)
|
||||
# cmake_policy(SET CMP0024 NEW)
|
||||
#endif()
|
||||
|
||||
if (POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW)
|
||||
endif()
|
||||
|
||||
# General Advice
|
||||
#
|
||||
|
@ -577,10 +583,10 @@ if (LWS_HAVE_PTHREAD_H AND NOT LWS_PLAT_FREERTOS)
|
|||
set(LWS_PTHR_FLAGS "-pthread")
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LWS_PTHR_FLAGS})
|
||||
if (NOT WIN32 AND NOT MSVC)
|
||||
list(APPEND LIB_LIST_AT_END ${LWS_PTHR_FLAGS})
|
||||
endif()
|
||||
# set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LWS_PTHR_FLAGS})
|
||||
# if (NOT WIN32 AND NOT MSVC)
|
||||
# list(APPEND LIB_LIST_AT_END ${LWS_PTHR_FLAGS})
|
||||
#endif()
|
||||
endif()
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("#define _GNU_SOURCE
|
||||
|
@ -739,11 +745,16 @@ endif()
|
|||
|
||||
|
||||
if (LWS_WITH_FSMOUNT AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
message("libmount include dir: ${LIBMOUNT_INC_PATH}")
|
||||
message("libmount libraries: ${LIBMOUNT_LIB_PATH}")
|
||||
|
||||
include_directories("${LIBMOUNT_INC_PATH}")
|
||||
list(APPEND LIB_LIST ${LIBMOUNT_LIB_PATH})
|
||||
if (NOT LWS_LIBMOUNT_INCLUDE_DIRS STREQUAL "")
|
||||
include_directories(${LWS_LIBMOUNT_INCLUDE_DIRS})
|
||||
message("libmount include dir: ${LWS_LIBMOUNT_INCLUDE_DIRS}")
|
||||
endif()
|
||||
if (NOT LWS_LIBMOUNT_LIBRARIES STREQUAL "")
|
||||
message("libmount libraries: ${LWS_LIBMOUNT_LIBRARIES}")
|
||||
list(APPEND LIB_LIST ${LWS_LIBMOUNT_LIBRARIES})
|
||||
else()
|
||||
list(APPEND LIB_LIST mount)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -767,6 +778,7 @@ if (LWS_WITH_HUBBUB)
|
|||
list(APPEND LIB_LIST ${LIBHUBBUB_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# Append the "at end" pieces to the lib list
|
||||
#
|
||||
|
|
|
@ -99,23 +99,6 @@ endif()
|
|||
|
||||
list(APPEND LIB_LIST_AT_END dl)
|
||||
|
||||
if (LWS_WITH_FSMOUNT AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
if ("${LWS_LIBMOUNT_LIBRARIES}" STREQUAL "" OR "${LWS_LIBMOUNT_INCLUDE_DIRS}" STREQUAL "")
|
||||
|
||||
# libmount paths (this is only on Linux)
|
||||
#
|
||||
find_path( LIBMOUNT_INC_PATH NAMES "libmount/libmount.h")
|
||||
find_library(LIBMOUNT_LIB_PATH NAMES "mount")
|
||||
else()
|
||||
set(LIBMOUNT_INC_PATH ${LWS_LIBMOUNT_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
set(LIBMOUNT_LIB_PATH ${LWS_LIBMOUNT_LIBRARIES} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if (NOT LIBMOUNT_INC_PATH OR NOT LIBMOUNT_LIB_PATH)
|
||||
message(FATAL_ERROR " Unable to find libmount")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Keep explicit parent scope exports at end
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue