代码拉取完成,页面将自动刷新
From cb1d37837d76928670c414d3b498d898ee0b32ae Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Tue, 16 Mar 2021 10:37:07 +0800
Subject: [PATCH] libevhtp: add securce compile options
Signed-off-by: wujing <wujing50@huawei.com>
---
CMakeLists.txt | 7 ++++++-
cmake/options.cmake | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbb0f50..5bc89d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,7 +110,12 @@ elseif(EVHTP_ALLOCATOR STREQUAL "tcmalloc")
endif()
endif()
-add_library(evhtp SHARED ${LIBEVHTP_SOURCE_FILES})
+if (NOT EVHTP_BUILD_SHARED)
+ add_library(evhtp ${LIBEVHTP_SOURCE_FILES})
+else()
+ add_library(evhtp SHARED ${LIBEVHTP_SOURCE_FILES})
+ target_link_options(evhtp PUBLIC "-Wl,-z,now -s")
+endif()
target_link_libraries(evhtp PUBLIC ${LIBEVHTP_EXTERNAL_LIBS})
target_include_directories(evhtp PUBLIC ${LIBEVHTP_EXTERNAL_INCLUDES})
diff --git a/cmake/options.cmake b/cmake/options.cmake
index 1738642..e781110 100644
--- a/cmake/options.cmake
+++ b/cmake/options.cmake
@@ -11,6 +11,9 @@ option (EVHTP_DISABLE_REGEX "Disable regex support" OFF)
# -DEVHTP_DEBUG=ON
option (EVHTP_DEBUG "Enable verbose debug logging" OFF)
+# -DEVHTP_BUILD_SHARED=ON
+option (EVHTP_BUILD_SHARED "Build shared libraries" OFF)
+
# can be overwritten by new set_alloc functions
set(EVHTP_ALLOCATOR CACHE STRING "Allocator library")
set_property(CACHE EVHTP_ALLOCATOR PROPERTY STRINGS "jemalloc;tcmalloc")
--
2.29.2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。