1 Star 0 Fork 18

swf504/dpu-utilities

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0006-add-cmake-compile-for-user-binary-and-so.patch 2.26 KB
一键复制 编辑 原始数据 按行查看 历史
swf504 提交于 2023-07-07 03:49 . Upgrade to new version of dpu-utilities
From fbde8e2d0b6f66daf7aacb7348dffb97721bca7c Mon Sep 17 00:00:00 2001
From: liqiang <liqiang64@huawei.com>
Date: Thu, 8 Jun 2023 15:58:09 +0800
Subject: add cmake compile for user binary and so
Signed-off-by: liqiang <liqiang64@huawei.com>
---
qtfs/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 qtfs/CMakeLists.txt
diff --git a/qtfs/CMakeLists.txt b/qtfs/CMakeLists.txt
new file mode 100644
index 0000000..d5b65ec
--- /dev/null
+++ b/qtfs/CMakeLists.txt
@@ -0,0 +1,34 @@
+cmake_minimum_required(VERSION 3.0.0)
+
+project(qtfs)
+
+set(CMAKE_C_FLAGS "-g -O2 -fstack-protector-strong -fPIE -pie -fPIC -D_FORTIFY_SOURCE=2 -s -Wl,-z,now -Wl,-z,noexecstack")
+
+# Build rexec and rexec_server
+add_executable(rexec rexec/rexec.c rexec/rexec_sock.c)
+add_executable(rexec_server rexec/rexec_server.c rexec/rexec_sock.c rexec/rexec_shim.c)
+target_include_directories(rexec_server PRIVATE /usr/include/glib-2.0 /usr/lib64/glib-2.0/include)
+target_link_libraries(rexec PRIVATE json-c)
+target_link_libraries(rexec_server PRIVATE json-c glib-2.0)
+
+# Build udsproxyd and libudsproxy.so
+add_executable(udsproxyd ipc/uds_event.c ipc/uds_main.c)
+add_library(udsproxy SHARED ipc/uds_connector.c)
+target_include_directories(udsproxyd PRIVATE include/ /usr/include/glib-2.0 /usr/lib64/glib-2.0/include)
+target_link_libraries(udsproxyd PRIVATE pthread glib-2.0)
+
+# Build engine
+add_executable(engine ipc/uds_main.c ipc/uds_event.c qtfs_common/user_engine.c)
+target_include_directories(engine PRIVATE include/ ./ ipc/ /usr/include/glib-2.0 /usr/lib64/glib-2.0/include)
+target_link_libraries(engine PRIVATE glib-2.0 pthread)
+target_compile_options(engine PRIVATE "-DQTFS_SERVER")
+
+if(DEFINED UDS_TEST_MODE OR DEFINED QTFS_TEST_MODE)
+target_compile_options(engine PRIVATE "-DUDS_TEST_MODE")
+target_compile_options(udsproxyd PRIVATE "-DUDS_TEST_MODE")
+message(WARNING "Important risk warning: the test mode is turned on, and qtfs will expose the network port, \
+ which will bring security risks and is only for testing! If you do not understand the risks,\
+ please don't use or compile again without test mode macro!")
+endif()
+
+set(ignoreMe "${QTFS_TEST_MODE}${UDS_TEST_MODE}")
\ No newline at end of file
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/swf504/dpu-utilities.git
git@gitee.com:swf504/dpu-utilities.git
swf504
dpu-utilities
dpu-utilities
master

搜索帮助