diff --git "a/sdk/docs/HelloWorld\345\274\200\345\217\221\346\265\201\347\250\213\345\222\214\347\211\271\346\200\247\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/docs/HelloWorld\345\274\200\345\217\221\346\265\201\347\250\213\345\222\214\347\211\271\346\200\247\344\275\277\347\224\250\346\214\207\345\215\227.md"
similarity index 93%
rename from "sdk/docs/HelloWorld\345\274\200\345\217\221\346\265\201\347\250\213\345\222\214\347\211\271\346\200\247\344\275\277\347\224\250\346\214\207\345\215\227.md"
rename to "docs/HelloWorld\345\274\200\345\217\221\346\265\201\347\250\213\345\222\214\347\211\271\346\200\247\344\275\277\347\224\250\346\214\207\345\215\227.md"
index 04bb7b7265033ea4997085a1fbf7a4a5db6eeed2..0b067528eff86f4e7c0a4c79ef21997849bf54d1 100644
--- "a/sdk/docs/HelloWorld\345\274\200\345\217\221\346\265\201\347\250\213\345\222\214\347\211\271\346\200\247\344\275\277\347\224\250\346\214\207\345\215\227.md"
+++ "b/docs/HelloWorld\345\274\200\345\217\221\346\265\201\347\250\213\345\222\214\347\211\271\346\200\247\344\275\277\347\224\250\346\214\207\345\215\227.md"
@@ -8,14 +8,14 @@ HelloWorld开发流程
- 安全侧的代码的编写
- 调用sign_tool.sh对安全侧编译出的so做签名
-以[HelloWorld](../../examples/helloworld)样例源码为例详细介绍开发步骤。
+以[HelloWorld](../examples/helloworld)样例源码为例详细介绍开发步骤。
### 1 编写edl接口文件
edl文件定义了非安全侧与安全侧交互的接口声明,类似于传统的头文件接口声明,由codegen辅助代码生成工具根据edl文件编译生成非安全侧与安全侧交互代码,从而帮助用户降低开发成本,聚焦业务逻辑。目前ocall仅在sgx平台支持,itrustee尚不支持。
如下定义了ecall函数get_string。
-[参考 HelloWorld edl文件](../../examples/helloworld/helloworld.edl)
+[参考 HelloWorld edl文件](../examples/helloworld/helloworld.edl)
```
enclave {
@@ -39,7 +39,7 @@ edl文件定义了非安全侧与安全侧交互的接口声明,类似于传
- 调用ecall函数
- 调用cc_enclave_destroy销毁enclave
-[参考 HelloWorld main.c文件](../../examples/helloworld/host/main.c)
+[参考 HelloWorld main.c文件](../examples/helloworld/host/main.c)
```
// 创建enclave
res = cc_enclave_create(real_p, AUTO_ENCLAVE_TYPE, 0, SECGEAR_DEBUG_FLAG, NULL, 0, context);
@@ -54,7 +54,7 @@ edl文件定义了非安全侧与安全侧交互的接口声明,类似于传
```
### 3 调用codegen工具
-[参考 HelloWorld host/CMakeLists.txt文件](../../examples/helloworld/host/CMakeLists.txt)
+[参考 HelloWorld host/CMakeLists.txt文件](../examples/helloworld/host/CMakeLists.txt)
Helloworld样例的编译工程已经集成codegen的调用,如下。
@@ -72,20 +72,20 @@ Helloworld样例的编译工程已经集成codegen的调用,如下。
开发者在安全侧需要完成:
- edl文件中定义的ecall函数的实现,edl文件相当于头文件
-[参考 HelloWorld hello.c文件](../../examples/helloworld/enclave/hello.c)
+[参考 HelloWorld hello.c文件](../examples/helloworld/enclave/hello.c)
test_t.h:该头文件为自动生成代码工具codegen通过edl文件生成的头文件,该头文件命名为edl文件名加"_t"。
### 5 调用签名工具
-[参考 HelloWorld enclave/CMakeLists.txt文件](../../examples/helloworld/enclave/CMakeLists.txt)
+[参考 HelloWorld enclave/CMakeLists.txt文件](../examples/helloworld/enclave/CMakeLists.txt)
使用SIGN_TOOL对编译出的.so文件进行签名。
### 6 配置开发者证书
-仅适用鲲鹏平台,以[examples/helloworld](../../examples/helloworld)样例介绍
+仅适用鲲鹏平台,以[examples/helloworld](../examples/helloworld)样例介绍
- 修改uuid
- 修改[examples/helloworld/CMakeLists.txt](../../examples/helloworld/CMakeLists.txt)中uuid
+ 修改[examples/helloworld/CMakeLists.txt](../examples/helloworld/CMakeLists.txt)中uuid
```
if(CC_GP)
@@ -96,7 +96,7 @@ if(CC_GP)
```
- 配置证书路径
-修改[examples/helloworld/enclave/config_cloud.ini](../../examples/helloworld/enclave/config_cloud.ini)配置证书路径
+修改[examples/helloworld/enclave/config_cloud.ini](../examples/helloworld/enclave/config_cloud.ini)配置证书路径
```
;private key for signing TA
@@ -109,7 +109,7 @@ configPath = /home/TA_cert/secgear-app1/config # config开发者证书的路径
```
- 修改manifest.txt
-参照申请证书是的configs.xml字段,修改[manifest.txt](../../examples/helloworld/enclave/manifest.txt)中字段
+参照申请证书是的configs.xml字段,修改[manifest.txt](../examples/helloworld/enclave/manifest.txt)中字段
如果configs.xml中存在,manifest.txt中没有,需要自行添加。
```
@@ -123,7 +123,7 @@ gpd.ta.stackSize: 40960
```
- 开启签名
-在[examples/helloworld/enclave/CMakeLists.txt](../../examples/helloworld/enclave/CMakeLists.txt)中找到如下注释的行,打开注释
+在[examples/helloworld/enclave/CMakeLists.txt](../examples/helloworld/enclave/CMakeLists.txt)中找到如下注释的行,打开注释
```
add_custom_command(TARGET ${PREFIX}
@@ -187,7 +187,7 @@ typedef struct {
| num_cores | 用于设置安全侧线程绑核
规格:
最大值为当前环境CPU核数 |
### 4 switchless开发流程
-[参考 switchless README.md文件](../../examples/switchless/README.md)
+[参考 switchless README.md文件](../examples/switchless/README.md)
### 5 switchless性能优化
#### 5.1 CPU绑核
@@ -397,4 +397,4 @@ API清单
| sign_tool.sh | sign_tool 包含 sign 指令(对 enclave 进行签名)和 digest 指令(生成摘要值) |
| codegen | 代码生成工具,根据edl文件编译生成非安全侧与安全侧交互代码 |
-[sign_tool.sh](../docs/sign_tool.md) 和[codegen](../docs/codegener.md)可使用-h打印帮助信息。
\ No newline at end of file
+[sign_tool.sh](./sign_tool.md) 和[codegen](./codegener.md)可使用-h打印帮助信息。
\ No newline at end of file
diff --git a/sdk/docs/build_install.md b/docs/build_install.md
similarity index 100%
rename from sdk/docs/build_install.md
rename to docs/build_install.md
diff --git a/sdk/docs/codegener.md b/docs/codegener.md
similarity index 100%
rename from sdk/docs/codegener.md
rename to docs/codegener.md
diff --git a/sdk/docs/disclaimer.md b/docs/disclaimer.md
similarity index 100%
rename from sdk/docs/disclaimer.md
rename to docs/disclaimer.md
diff --git a/sdk/docs/en/2403_LTS_SP2/_toc.yaml b/docs/en/2403_LTS_SP2/_toc.yaml
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/_toc.yaml
rename to docs/en/2403_LTS_SP2/_toc.yaml
diff --git a/sdk/docs/en/2403_LTS_SP2/api_reference.md b/docs/en/2403_LTS_SP2/api_reference.md
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/api_reference.md
rename to docs/en/2403_LTS_SP2/api_reference.md
diff --git a/sdk/docs/en/2403_LTS_SP2/application_scenarios.md b/docs/en/2403_LTS_SP2/application_scenarios.md
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/application_scenarios.md
rename to docs/en/2403_LTS_SP2/application_scenarios.md
diff --git a/sdk/docs/en/2403_LTS_SP2/developer_guide.md b/docs/en/2403_LTS_SP2/developer_guide.md
similarity index 96%
rename from sdk/docs/en/2403_LTS_SP2/developer_guide.md
rename to docs/en/2403_LTS_SP2/developer_guide.md
index b68c0a800a9b4b4e54f295b27674de0f711a2bfb..360a298f0ebb23ec1948095394524254da1ea638 100644
--- a/sdk/docs/en/2403_LTS_SP2/developer_guide.md
+++ b/docs/en/2403_LTS_SP2/developer_guide.md
@@ -42,7 +42,7 @@ In addition to the preceding three parts, there are compilation project file (**
> [!NOTE]NOTE
>
> - The Kunpeng developer license needs to be [applied for from the Huawei service owner](https://www.hikunpeng.com/document/detail/en/kunpengcctrustzone/fg-tz/kunpengtrustzone_04_0009.html).
-> - Because Intel SGX is debugged in debug mode, you do not need to apply for a developer license currently. If the remote attestation service of Intel is required for commercial use, you need to [apply for a license from Intel](https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/request-license.html).
+> - Because Intel SGX is debugged in debug mode, you do not need to apply for a developer license currently. If the remote attestation service of Intel is required for commercial use, you need to apply for a license from Intel.
After the application is successful, the developer license file is obtained and needs to be stored in the corresponding code directory.
diff --git a/sdk/docs/en/2403_LTS_SP2/figures/BJCA_Crypto_Module.png b/docs/en/2403_LTS_SP2/figures/BJCA_Crypto_Module.png
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/figures/BJCA_Crypto_Module.png
rename to docs/en/2403_LTS_SP2/figures/BJCA_Crypto_Module.png
diff --git a/sdk/docs/en/2403_LTS_SP2/figures/Mindspore.png b/docs/en/2403_LTS_SP2/figures/Mindspore.png
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/figures/Mindspore.png
rename to docs/en/2403_LTS_SP2/figures/Mindspore.png
diff --git a/sdk/docs/en/2403_LTS_SP2/figures/Mindspore_original.png b/docs/en/2403_LTS_SP2/figures/Mindspore_original.png
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/figures/Mindspore_original.png
rename to docs/en/2403_LTS_SP2/figures/Mindspore_original.png
diff --git a/sdk/docs/en/2403_LTS_SP2/figures/develop_step.png b/docs/en/2403_LTS_SP2/figures/develop_step.png
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/figures/develop_step.png
rename to docs/en/2403_LTS_SP2/figures/develop_step.png
diff --git a/sdk/docs/en/2403_LTS_SP2/figures/openLooKeng.png b/docs/en/2403_LTS_SP2/figures/openLooKeng.png
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/figures/openLooKeng.png
rename to docs/en/2403_LTS_SP2/figures/openLooKeng.png
diff --git a/sdk/docs/en/2403_LTS_SP2/figures/secGear_arch.png b/docs/en/2403_LTS_SP2/figures/secGear_arch.png
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/figures/secGear_arch.png
rename to docs/en/2403_LTS_SP2/figures/secGear_arch.png
diff --git a/sdk/docs/en/2403_LTS_SP2/figures/secret_gaussdb.png b/docs/en/2403_LTS_SP2/figures/secret_gaussdb.png
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/figures/secret_gaussdb.png
rename to docs/en/2403_LTS_SP2/figures/secret_gaussdb.png
diff --git a/sdk/docs/en/2403_LTS_SP2/introduction_to_secgear.md b/docs/en/2403_LTS_SP2/introduction_to_secgear.md
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/introduction_to_secgear.md
rename to docs/en/2403_LTS_SP2/introduction_to_secgear.md
diff --git a/sdk/docs/en/2403_LTS_SP2/public_sys-resources/icon-note.gif b/docs/en/2403_LTS_SP2/public_sys-resources/icon-note.gif
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/public_sys-resources/icon-note.gif
rename to docs/en/2403_LTS_SP2/public_sys-resources/icon-note.gif
diff --git a/sdk/docs/en/2403_LTS_SP2/secgear_installation.md b/docs/en/2403_LTS_SP2/secgear_installation.md
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/secgear_installation.md
rename to docs/en/2403_LTS_SP2/secgear_installation.md
diff --git a/sdk/docs/en/2403_LTS_SP2/using_secgear_tools.md b/docs/en/2403_LTS_SP2/using_secgear_tools.md
similarity index 100%
rename from sdk/docs/en/2403_LTS_SP2/using_secgear_tools.md
rename to docs/en/2403_LTS_SP2/using_secgear_tools.md
diff --git a/sdk/docs/itrustee_libc_support.md b/docs/itrustee_libc_support.md
similarity index 100%
rename from sdk/docs/itrustee_libc_support.md
rename to docs/itrustee_libc_support.md
diff --git a/sdk/docs/logo.png b/docs/logo.png
similarity index 100%
rename from sdk/docs/logo.png
rename to docs/logo.png
diff --git a/sdk/docs/riscv_tee.md b/docs/riscv_tee.md
similarity index 100%
rename from sdk/docs/riscv_tee.md
rename to docs/riscv_tee.md
diff --git a/sdk/docs/secGear_RISC-V_Penglai_demo.jpeg b/docs/secGear_RISC-V_Penglai_demo.jpeg
similarity index 100%
rename from sdk/docs/secGear_RISC-V_Penglai_demo.jpeg
rename to docs/secGear_RISC-V_Penglai_demo.jpeg
diff --git a/sdk/docs/sign_tool.md b/docs/sign_tool.md
similarity index 100%
rename from sdk/docs/sign_tool.md
rename to docs/sign_tool.md
diff --git a/sdk/docs/zh/2403_LTS_SP2/_toc.yaml b/docs/zh/2403_LTS_SP2/_toc.yaml
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/_toc.yaml
rename to docs/zh/2403_LTS_SP2/_toc.yaml
diff --git a/sdk/docs/zh/2403_LTS_SP2/api_reference.md b/docs/zh/2403_LTS_SP2/api_reference.md
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/api_reference.md
rename to docs/zh/2403_LTS_SP2/api_reference.md
diff --git a/sdk/docs/zh/2403_LTS_SP2/application_scenarios.md b/docs/zh/2403_LTS_SP2/application_scenarios.md
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/application_scenarios.md
rename to docs/zh/2403_LTS_SP2/application_scenarios.md
diff --git a/sdk/docs/zh/2403_LTS_SP2/developer_guide.md b/docs/zh/2403_LTS_SP2/developer_guide.md
similarity index 93%
rename from sdk/docs/zh/2403_LTS_SP2/developer_guide.md
rename to docs/zh/2403_LTS_SP2/developer_guide.md
index f82693e6c03933c0b62cf5a5b5495bb6946bbf70..caf4aca027c955ab30d8de417f70e160425bc2ef 100644
--- a/sdk/docs/zh/2403_LTS_SP2/developer_guide.md
+++ b/docs/zh/2403_LTS_SP2/developer_guide.md
@@ -42,7 +42,7 @@ cd examples/helloworld
> 说明:
>
> - 鲲鹏开发者证书需要向华为业务负责人[申请开发者证书](https://gitee.com/link?target=https%3A%2F%2Fwww.hikunpeng.com%2Fdocument%2Fdetail%2Fzh%2Fkunpengcctrustzone%2Ffg-tz%2Fkunpengtrustzone_04_0009.html)。
-> - SGX以Debug模式调试,暂时不用申请。如需正式商用并且用intel的远程证明服务,需要向Intel[申请License](https://gitee.com/link?target=https%3A%2F%2Fwww.intel.com%2Fcontent%2Fwww%2Fus%2Fen%2Fdeveloper%2Ftools%2Fsoftware-guard-extensions%2Frequest-license.html)。
+> - SGX以Debug模式调试,暂时不用申请。如需正式商用并且用intel的远程证明服务,需要向Intel申请License。
申请成功后会得到开发者证书相关文件,需要放置到代码目录相应位置。
diff --git a/sdk/docs/zh/2403_LTS_SP2/figures/BJCA_Crypto_Module.png b/docs/zh/2403_LTS_SP2/figures/BJCA_Crypto_Module.png
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/figures/BJCA_Crypto_Module.png
rename to docs/zh/2403_LTS_SP2/figures/BJCA_Crypto_Module.png
diff --git a/sdk/docs/zh/2403_LTS_SP2/figures/Mindspore.png b/docs/zh/2403_LTS_SP2/figures/Mindspore.png
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/figures/Mindspore.png
rename to docs/zh/2403_LTS_SP2/figures/Mindspore.png
diff --git a/sdk/docs/zh/2403_LTS_SP2/figures/Mindspore_original.png b/docs/zh/2403_LTS_SP2/figures/Mindspore_original.png
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/figures/Mindspore_original.png
rename to docs/zh/2403_LTS_SP2/figures/Mindspore_original.png
diff --git a/sdk/docs/zh/2403_LTS_SP2/figures/develop_step.png b/docs/zh/2403_LTS_SP2/figures/develop_step.png
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/figures/develop_step.png
rename to docs/zh/2403_LTS_SP2/figures/develop_step.png
diff --git a/sdk/docs/zh/2403_LTS_SP2/figures/openLooKeng.png b/docs/zh/2403_LTS_SP2/figures/openLooKeng.png
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/figures/openLooKeng.png
rename to docs/zh/2403_LTS_SP2/figures/openLooKeng.png
diff --git a/sdk/docs/zh/2403_LTS_SP2/figures/secGear_arch.png b/docs/zh/2403_LTS_SP2/figures/secGear_arch.png
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/figures/secGear_arch.png
rename to docs/zh/2403_LTS_SP2/figures/secGear_arch.png
diff --git a/sdk/docs/zh/2403_LTS_SP2/figures/secret_gaussdb.png b/docs/zh/2403_LTS_SP2/figures/secret_gaussdb.png
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/figures/secret_gaussdb.png
rename to docs/zh/2403_LTS_SP2/figures/secret_gaussdb.png
diff --git a/sdk/docs/zh/2403_LTS_SP2/introduction_to_secgear.md b/docs/zh/2403_LTS_SP2/introduction_to_secgear.md
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/introduction_to_secgear.md
rename to docs/zh/2403_LTS_SP2/introduction_to_secgear.md
diff --git a/sdk/docs/zh/2403_LTS_SP2/public_sys-resources/icon-note.gif b/docs/zh/2403_LTS_SP2/public_sys-resources/icon-note.gif
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/public_sys-resources/icon-note.gif
rename to docs/zh/2403_LTS_SP2/public_sys-resources/icon-note.gif
diff --git a/sdk/docs/zh/2403_LTS_SP2/secgear_installation.md b/docs/zh/2403_LTS_SP2/secgear_installation.md
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/secgear_installation.md
rename to docs/zh/2403_LTS_SP2/secgear_installation.md
diff --git a/sdk/docs/zh/2403_LTS_SP2/using_secgear_tools.md b/docs/zh/2403_LTS_SP2/using_secgear_tools.md
similarity index 100%
rename from sdk/docs/zh/2403_LTS_SP2/using_secgear_tools.md
rename to docs/zh/2403_LTS_SP2/using_secgear_tools.md
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
deleted file mode 100644
index 9d66eabbfbfc4ad6e5f6a923e7bdbe590c7dc26b..0000000000000000000000000000000000000000
--- a/examples/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-add_custom_target(copy ALL
- COMMAND mkdir -p ${CMAKE_BINARY_DIR}/inc/secGear
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/host_inc/*.h ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/enclave_inc/*.h ${CMAKE_BINARY_DIR}/inc/secGear/)
-
-if(CC_GP)
- add_custom_command(TARGET copy
- POST_BUILD
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/host_inc/gp/*.edl ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/host_inc/gp/*.h ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/enclave_inc/gp/*.h ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/enclave_inc/gp/itrustee/*.h ${CMAKE_BINARY_DIR}/inc/secGear/)
- add_subdirectory(seal_data)
- add_subdirectory(helloworld)
- add_subdirectory(switchless)
- #add_subdirectory(lrt)
-endif()
-
-if(CC_SGX)
- add_custom_command(TARGET copy
- POST_BUILD
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/host_inc/sgx/*.h ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/host_inc/sgx/*.edl ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/enclave_inc/sgx/*.h ${CMAKE_BINARY_DIR}/inc/secGear/)
- add_subdirectory(seal_data)
- add_subdirectory(helloworld)
- add_subdirectory(switchless)
- #add_subdirectory(lrt)
-endif()
-
-if(CC_PL)
- add_custom_command(TARGET copy
- POST_BUILD
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/host_inc/penglai/*.h ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/host_inc/penglai/*.edl ${CMAKE_BINARY_DIR}/inc/secGear/
- COMMAND cp ${LOCAL_ROOT_PATH}/inc/enclave_inc/penglai/*.h ${CMAKE_BINARY_DIR}/inc/secGear/)
- # add_subdirectory(seal_data)
- add_subdirectory(helloworld)
- #add_subdirectory(lrt)
-endif()
-add_subdirectory(ra_tls)
diff --git a/sdk/CMakeLists.txt b/sdk/CMakeLists.txt
index 7e16c212e5f61a049cabbcc75f2c6fde2ce8f0a6..789b3c7f316fc1ea34c52eb6842e984128da0f97 100644
--- a/sdk/CMakeLists.txt
+++ b/sdk/CMakeLists.txt
@@ -38,6 +38,10 @@ set(SGX_SDK_DEFAULT_PATH /opt/intel/sgxsdk)
set(GP_SDK_DEFAULT_PATH /opt/itrustee_sdk)
set(PL_SDK_DEFAULT_PATH /root/dev/sdk)
+if (NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Debug")
+endif()
+
if(CMAKE_BUILD_TYPE MATCHES "Debug")
add_definitions(-DDEBUG_FILE_LINE)
#set enclave log level
diff --git a/sdk/component/ra_tls/CMakeLists.txt b/sdk/component/ra_tls/CMakeLists.txt
index 7644a6998696d20dd28384801dff873bd029cb37..c7f4ed2799f92d140db02c25d12c115aa340d424 100644
--- a/sdk/component/ra_tls/CMakeLists.txt
+++ b/sdk/component/ra_tls/CMakeLists.txt
@@ -34,6 +34,15 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/base64url)
set(LIB_SRC ${LIB_SRC} ${BASE64_SRC})
add_library(${LIB_NAME} SHARED ${LIB_SRC})
+
+if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
+ target_link_directories(${LIB_NAME} PUBLIC
+ ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ )
+else()
+ link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${CMAKE_BINARY_DIR}/lib)
+endif()
+
target_link_libraries(${LIB_NAME} PUBLIC ${LD_SO})
set_target_properties(${LIB_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
diff --git a/sdk/component/secure_channel/client/CMakeLists.txt b/sdk/component/secure_channel/client/CMakeLists.txt
index 2a4180dd32dc6b83bbd1d0cec5d02998cca33cf8..445ebc617b635d0bb834a1e24b9fa4c0077ccf95 100644
--- a/sdk/component/secure_channel/client/CMakeLists.txt
+++ b/sdk/component/secure_channel/client/CMakeLists.txt
@@ -20,6 +20,12 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+
+ if (CMAKE_BUILD_TYPE MATCHES "Debug")
+ link_directories(${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug)
+ else()
+ link_directories(${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release)
+ endif()
endif()
include_directories(
@@ -38,9 +44,17 @@ add_library(c${PREFIX} SHARED ${SOURCE_FILE} ${CJSON_SRC} ${BASE64_SRC})
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
target_link_directories(c${PREFIX} PRIVATE
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release
- ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug
)
+
+ if(CMAKE_BUILD_TYPE MATCHES "Debug")
+ target_link_directories(c${PREFIX} PRIVATE
+ ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug
+ )
+ else()
+ target_link_directories(c${PREFIX} PRIVATE
+ ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release
+ )
+ endif()
endif()
target_link_libraries(c${PREFIX} ssl crypto secgear_verify attestation_agent)
diff --git a/sdk/component/secure_channel/host/CMakeLists.txt b/sdk/component/secure_channel/host/CMakeLists.txt
index 671e1af020d1b355d068a16aaf65412235f1c6c6..6fb1167ad6de247703a266368746e825a8f280e9 100644
--- a/sdk/component/secure_channel/host/CMakeLists.txt
+++ b/sdk/component/secure_channel/host/CMakeLists.txt
@@ -38,7 +38,13 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-maybe-uninitialized -fPIC")
if(CC_GP)
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- ${CMAKE_BINARY_DIR}/lib/)
+ ${CMAKE_BINARY_DIR}/lib)
+
+ if (CMAKE_BUILD_TYPE MATCHES "Debug")
+ link_directories(${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug)
+ else()
+ link_directories(${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release)
+ endif()
endif()
include_directories(
@@ -58,10 +64,19 @@ if(CC_GP)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
target_link_directories(u${PREFIX} PRIVATE
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release
- ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug
+ ${CMAKE_BINARY_DIR}/lib
+ )
+
+ if(CMAKE_BUILD_TYPE MATCHES "Debug")
+ target_link_directories(u${PREFIX} PRIVATE
+ ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug
+ )
+ else()
+ target_link_directories(u${PREFIX} PRIVATE
+ ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release
)
endif()
+ endif()
target_link_libraries(u${PREFIX} secgear_ra attestation_agent)
endif()
@@ -77,7 +92,13 @@ if(CC_SGX)
if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- ${CMAKE_BINARY_DIR}/lib/)
+ ${CMAKE_BINARY_DIR}/lib)
+
+ if (CMAKE_BUILD_TYPE MATCHES "Debug")
+ link_directories(${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug)
+ else()
+ link_directories(${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release)
+ endif()
endif()
include_directories(
@@ -98,10 +119,18 @@ if(CC_SGX)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
target_link_directories(u${PREFIX} PRIVATE
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
- ${CMAKE_BINARY_DIR}/lib/
- ${CMAKE_SOURCE_DIR}/../service/attestation/attestation-agent/target/release
- ${CMAKE_SOURCE_DIR}/../service/attestation/attestation-agent/target/debug
+ ${CMAKE_BINARY_DIR}/lib
)
+
+ if(CMAKE_BUILD_TYPE MATCHES "Debug")
+ target_link_directories(u${PREFIX} PRIVATE
+ ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/debug
+ )
+ else()
+ target_link_directories(u${PREFIX} PRIVATE
+ ${LOCAL_ROOT_PATH}/../service/attestation/attestation-agent/target/release
+ )
+ endif()
endif()
target_link_libraries(u${PREFIX} secgear_ra attestation_agent)
endif()