Skip to content

Commit

Permalink
cmake: fix jemalloc, libevent include dirs
Browse files Browse the repository at this point in the history
Caught with cmake --warn-uninitialized.
  • Loading branch information
Lekensteyn committed Mar 13, 2016
1 parent 2b3bc71 commit dad222b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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:
Expand All @@ -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}
Expand Down
6 changes: 4 additions & 2 deletions cmake/ExtractValidFlags.cmake
Original file line number Diff line number Diff line change
@@ -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}")
Expand All @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindJemalloc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

Expand Down

0 comments on commit dad222b

Please sign in to comment.