Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
minor updates for pull #33
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFrench committed Sep 20, 2017
1 parent f94cd15 commit ccf5ce4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
docs/
html/
build/*
!build/.gitkeep
cmake-build-debug
.idea
.idea

23 changes: 19 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ set(PROJECT_PATCH_VERSION 12)
set(PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION})

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPROJECT_VERSION=${PROJECT_VERSION} -Wall")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -ggdb3 -fsanitize=address -fsanitize=leak -fstack-protector-strong")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -ggdb3")

SET(CMAKE_BUILD_TYPE Release CACHE STRING "default to Release")

# will use later for htexpress API
# add_executable(lambda-pp lambda-pp.c)

# -DEVHTP_DISABLE_SSL:STRING=ON
OPTION(EVHTP_DISABLE_SSL "Disable ssl support" OFF)

Expand Down Expand Up @@ -86,6 +83,24 @@ TEST_BIG_ENDIAN(HOST_BIG_ENDIAN)

check_c_compiler_flag(-fvisibility=hidden EVHTP_HAS_VISIBILITY_HIDDEN)
check_c_compiler_flag(-std=c99 EVHTP_HAS_C99)
check_c_compiler_flag(-fsanitize=address EVHTP_HAS_SANITIZE_ADDRESS)
check_c_compiler_flag(-fsanitize=leak EVHTP_HAS_SANITIZE_LEAK)

# NOTE in as of ubuntu 14, this is enabled by default, so if you see it fail
# the check, don't freak out.
check_c_compiler_flag(-fstack-protector-strong EVHTP_HAS_STACK_PROTECTOR)

if (EVHTP_HAS_SANITIZE_ADDRESS)
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address")
endif()

if (EVHTP_HAS_SANITIZE_LEAK)
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=leak")
endif()

if (EVHTP_HAS_STACK_PROTECTOR)
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fstack-protector-strong")
endif()

if (EVHTP_HAS_C99)
add_definitions(-DEVHTP_HAS_C99)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(examples)

add_executable(test_general EXCLUDE_FROM_ALL test.c)
add_executable(test_extensive EXCLUDE_FROM_ALL test.c)
add_executable(test_basic EXCLUDE_FROM_ALL test_basic.c)
add_executable(test_vhost EXCLUDE_FROM_ALL test_vhost.c)
add_executable(test_client EXCLUDE_FROM_ALL test_client.c)
Expand All @@ -13,13 +13,13 @@ if (NOT EVHTP_DISABLE_EVTHR)
add_dependencies(examples test_proxy)
endif()

target_link_libraries(test_general evhtp ${LIBEVHTP_EXTERNAL_LIBS} ${SYS_LIBS})
target_link_libraries(test_extensive evhtp ${LIBEVHTP_EXTERNAL_LIBS} ${SYS_LIBS})
target_link_libraries(test_basic evhtp ${LIBEVHTP_EXTERNAL_LIBS} ${SYS_LIBS})
target_link_libraries(test_vhost evhtp ${LIBEVHTP_EXTERNAL_LIBS} ${SYS_LIBS})
target_link_libraries(test_client evhtp ${LIBEVHTP_EXTERNAL_LIBS} ${SYS_LIBS})
target_link_libraries(test_query evhtp ${LIBEVHTP_EXTERNAL_LIBS} ${SYS_LIBS})
target_link_libraries(test_perf evhtp ${LIBEVHTP_EXTERNAL_LIBS} ${SYS_LIBS})

add_dependencies(examples test_general test_basic test_vhost test_client test_query test_perf)
add_dependencies(examples test_extensive test_basic test_vhost test_client test_query test_perf)


0 comments on commit ccf5ce4

Please sign in to comment.