cmake: fix jemalloc, libevent include dirs

Caught with cmake --warn-uninitialized.
This commit is contained in:
Peter Wu 2016-03-13 16:41:21 +01:00
parent 2b3bc710fc
commit dad222b8f4
4 changed files with 7 additions and 9 deletions

View File

@ -120,7 +120,7 @@ endforeach()
include(CMakePushCheckState)
include(CheckCXXSourceCompiles)
cmake_push_check_state()
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${CXX1XCXXFLAGS}")
set(CMAKE_REQUIRED_DEFINITIONS "${CXX1XCXXFLAGS}")
# Check that std::future is available.
check_cxx_source_compiles("
#include <vector>
@ -429,7 +429,6 @@ add_subdirectory(contrib)
add_subdirectory(script)
# XXX fix shared/static library
string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type)
message(STATUS "summary of build options:
@ -445,9 +444,6 @@ message(STATUS "summary of build options:
CXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_build_type}}
WARNCFLAGS: ${WARNCFLAGS}
CXX1XCXXFLAGS: ${CXX1XCXXFLAGS}
Library:
Shared: ${enable_shared}
Static: ${enable_static}
Python:
Python: ${PYTHON_EXECUTABLE}
PYTHON_VERSION: ${PYTHON_VERSION_STRING}

View File

@ -1,10 +1,11 @@
# Convenience function that checks the availability
# of certain C or C++ compiler flags and appends valid ones.
# Convenience function that checks the availability of certain
# C or C++ compiler flags and returns valid ones as a string.
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
function(extract_valid_c_flags varname)
set(valid_flags)
foreach(flag IN LISTS ARGN)
string(REGEX REPLACE "[^a-zA-Z0-9_]+" "_" flag_var ${flag})
set(flag_var "C_FLAG_${flag_var}")
@ -17,6 +18,7 @@ function(extract_valid_c_flags varname)
endfunction()
function(extract_valid_cxx_flags varname)
set(valid_flags)
foreach(flag IN LISTS ARGN)
string(REGEX REPLACE "[^a-zA-Z0-9_]+" "_" flag_var ${flag})
set(flag_var "CXX_FLAG_${flag_var}")

View File

@ -9,7 +9,7 @@ pkg_check_modules(PC_JEMALLOC QUIET jemalloc)
find_path(JEMALLOC_INCLUDE_DIR
NAMES jemalloc/jemalloc.h
HINTS ${PC_PCJEMALLOC_INCLUDE_DIRS}
HINTS ${PC_JEMALLOC_INCLUDE_DIRS}
)
find_library(JEMALLOC_LIBRARY
NAMES jemalloc

View File

@ -13,7 +13,7 @@ if(ENABLE_EXAMPLES)
${CMAKE_SOURCE_DIR}/src/includes
${CMAKE_SOURCE_DIR}/third-party
${LIBEVENT_OPENSSL_INCLUDE_DIRS}
${LIBEVENT_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS}
)