mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-12 05:48:51 -04:00
Only look for ZLib when it is used (if tests are included).
Also make the project language C.
This commit is contained in:
parent
4ac086abc4
commit
f7805939d1
@ -59,13 +59,11 @@ include(CheckStructHasMember)
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckPrototypeDefinition)
|
||||
|
||||
include(FindZLIB) # -> HAVE_LIBZ
|
||||
|
||||
# Setup compiler flags for coverage.
|
||||
if (EVENT__COVERAGE)
|
||||
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(NOT CMAKE_COMPILER_IS_GNUCC)
|
||||
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting... You can set this on the command line using CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake <options> ..")
|
||||
message(FATAL_ERROR "Trying to compile coverage support (--DEVENT__COVERAGE) but compiler is not GNU gcc! Aborting... You can set this on the command line using CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake <options> ..")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -581,11 +579,16 @@ if (NOT EVENT__DISABLE_THREAD_SUPPORT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ZLIB_LIBRARY)
|
||||
set(EVENT__HAVE_ZLIB 1)
|
||||
set(EVENT__HAVE_ZLIB_H)
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
list(APPEND LIB_APPS ${ZLIB_LIBRARIES})
|
||||
if (NOT EVENT__DISABLE_TESTS)
|
||||
# Zlib is only used for testing.
|
||||
find_package(ZLIB)
|
||||
|
||||
if (ZLIB_LIBRARY)
|
||||
set(EVENT__HAVE_ZLIB 1)
|
||||
set(EVENT__HAVE_ZLIB_H)
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
list(APPEND LIB_APPS ${ZLIB_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(SRC_EXTRA
|
||||
|
@ -68,14 +68,14 @@ IF(NOT GCOV_PATH)
|
||||
MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
|
||||
ENDIF() # NOT GCOV_PATH
|
||||
|
||||
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
IF(NOT CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
# Clang version 3.0.0 and greater now supports gcov as well.
|
||||
MESSAGE(WARNING "Compiler is not GNU gcc! Clang Version 3.0.0 and greater supports gcov as well, but older versions don't.")
|
||||
|
||||
IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
|
||||
ENDIF()
|
||||
ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX
|
||||
ENDIF() # NOT CMAKE_COMPILER_IS_GNUCC
|
||||
|
||||
IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
|
||||
MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
|
||||
|
Loading…
x
Reference in New Issue
Block a user