This repository was archived by the owner on Dec 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathattachment.patch
More file actions
91 lines (86 loc) · 3.1 KB
/
attachment.patch
File metadata and controls
91 lines (86 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 745f969..88abd76 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.5.0)
project(ngen)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wno-terminate")
@@ -10,5 +10,5 @@ include_directories(core/include/attachments)
add_subdirectory(core)
add_subdirectory(attachments)
-add_subdirectory(docker)
-add_subdirectory(nodes)
+#add_subdirectory(docker)
+#add_subdirectory(nodes)
diff --git a/attachments/CMakeLists.txt b/attachments/CMakeLists.txt
index 7862ae9..f4b3ba9 100644
--- a/attachments/CMakeLists.txt
+++ b/attachments/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_subdirectory(nano_attachment)
+#add_subdirectory(nano_attachment)
if ("${ATTACHMENT_TYPE}" STREQUAL "envoy")
add_subdirectory(envoy)
elseif("${ATTACHMENT_TYPE}" STREQUAL "kong")
diff --git a/attachments/nginx/ngx_module/CMakeLists.txt b/attachments/nginx/ngx_module/CMakeLists.txt
index 8c8ae92..e8f700a 100644
--- a/attachments/nginx/ngx_module/CMakeLists.txt
+++ b/attachments/nginx/ngx_module/CMakeLists.txt
@@ -1,32 +1,3 @@
-MACRO(CREATE_INCLUDE_LIST result)
- file(READ ${CMAKE_INSTALL_PREFIX}/nginx-src/include_paths.mk relative_includes)
- STRING(REGEX REPLACE "\n" ";" relative_includes "${relative_includes}")
- set(inclist "")
- FOREACH(include ${relative_includes})
- if(NOT include MATCHES "^/")
- set(inclist ${inclist} "${CMAKE_INSTALL_PREFIX}/nginx-src/${include}")
- else()
- set(inclist ${inclist} "${include}")
- endif()
- ENDFOREACH()
- set(${result} ${inclist})
-ENDMACRO()
-
-MACRO(READ_COMPILE_FLAGS result)
- file(READ ${CMAKE_INSTALL_PREFIX}/nginx-src/cc_flags.mk CC_FLAGS)
- string(REGEX REPLACE "\n" "" CC_FLAGS "${CC_FLAGS}")
- set(flag_list "")
- FOREACH(flag ${CC_FLAGS})
- if (flag MATCHES "-fstack-clash-protection" OR flag MATCHES "-fcf-protection" OR flag MATCHES "-Wno-cast-function-type")
- continue()
- endif()
-
- set(flag_list ${flag_list} "${flag}")
- ENDFOREACH()
- separate_arguments(flag_list)
- set(${result} ${flag_list})
-ENDMACRO()
-
add_library(
ngx_module
SHARED
@@ -39,8 +10,13 @@ add_dependencies(ngx_module osrc_shmem_ipc osrc_nginx_attachment_util osrc_compr
target_link_libraries(ngx_module osrc_shmem_ipc osrc_nginx_attachment_util osrc_compression_utils)
-CREATE_INCLUDE_LIST(NGX_INCLUDES)
-READ_COMPILE_FLAGS(CC_FLAG_LIST)
+file(GLOB_RECURSE NGINX_DIRS LIST_DIRECTORIES true "/src/nginx/*")
+set(NGX_INCLUDES "/src/nginx")
+foreach(dir ${NGINX_DIRS})
+ if(IS_DIRECTORY ${dir})
+ list(APPEND NGX_INCLUDES ${dir})
+ endif()
+endforeach()
target_include_directories(ngx_module PRIVATE ${NGX_INCLUDES})
target_compile_options(ngx_module PRIVATE ${CC_FLAG_LIST})
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 8285065..19cdc99 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -1,4 +1,4 @@
add_subdirectory(shmem_ipc)
-add_subdirectory(shmem_ipc_2)
+#add_subdirectory(shmem_ipc_2)
add_subdirectory(compression)
add_subdirectory(attachments)