aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/CheckFunctionExistsEx.cmake
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-07-14 18:31:56 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-07-14 18:31:56 +0000
commit884d7a39094e590c9dc58f865b068f40694c6a49 (patch)
tree53915fc3eafdda183ab94c84e85ad7d7107afc6a /cmake/CheckFunctionExistsEx.cmake
parentc4d7c4bdab4c5587b42073d60fb6aca6e335d76e (diff)
parent023ea039b9fada42e0cbbefcd75858a855a6130a (diff)
downloadplatform_external_libevent-master.tar.gz
platform_external_libevent-master.tar.bz2
platform_external_libevent-master.zip
Upgrade libevent to release-2.1.12-stable am: f0077b80a0 am: 023ea039b9HEADmaster
Original change: https://android-review.googlesource.com/c/platform/external/libevent/+/1360893 Change-Id: Iee716ec96a55737a04463c7b84c929c2e6418c54
Diffstat (limited to 'cmake/CheckFunctionExistsEx.cmake')
-rw-r--r--cmake/CheckFunctionExistsEx.cmake69
1 files changed, 0 insertions, 69 deletions
diff --git a/cmake/CheckFunctionExistsEx.cmake b/cmake/CheckFunctionExistsEx.cmake
deleted file mode 100644
index 78bc2ec..0000000
--- a/cmake/CheckFunctionExistsEx.cmake
+++ /dev/null
@@ -1,69 +0,0 @@
-# - Check if a C function can be linked
-# CHECK_FUNCTION_EXISTS(<function> <variable>)
-#
-# Check that the <function> is provided by libraries on the system and
-# store the result in a <variable>. This does not verify that any
-# system header file declares the function, only that it can be found
-# at link time (considure using CheckSymbolExists).
-#
-# The following variables may be set before calling this macro to
-# modify the way the check is run:
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-
-#=============================================================================
-# Copyright 2002-2011 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-MACRO(CHECK_FUNCTION_EXISTS_EX FUNCTION VARIABLE)
- IF(${VARIABLE} MATCHES "^${VARIABLE}$")
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
- "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
- MESSAGE(STATUS "Looking for ${FUNCTION}")
- IF(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- TRY_COMPILE(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${PROJECT_SOURCE_DIR}/cmake/CheckFunctionExistsEx.c
- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- "${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}"
- OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
- MESSAGE(STATUS "Looking for ${FUNCTION} - found")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the function ${FUNCTION} exists passed with the following output:\n"
- "${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for ${FUNCTION} - not found")
- SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the function ${FUNCTION} exists failed with the following output:\n"
- "${OUTPUT}\n\n")
- ENDIF(${VARIABLE})
- ENDIF()
-ENDMACRO(CHECK_FUNCTION_EXISTS_EX)