From 3f1bf6f16a46d445f13b2db3655d6b251f8a0c9b Mon Sep 17 00:00:00 2001 From: Chia-Che Tsai Date: Sun, 22 Sep 2019 23:01:26 -0500 Subject: [PATCH] [PAL] Select PAL targets in CMakeLists.txt --- Pal/CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Pal/CMakeLists.txt b/Pal/CMakeLists.txt index ec0155fa..e2f47647 100644 --- a/Pal/CMakeLists.txt +++ b/Pal/CMakeLists.txt @@ -4,5 +4,16 @@ set_property(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS ON) project(graphene_pal) -add_subdirectory(src/host/Linux) -add_subdirectory(src/host/Linux-SGX) +if(NOT DEFINED SGX) + set(SGX $ENV{SGX}) +endif() + +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if(${SGX}) + message("PAL target: Linux SGX") + add_subdirectory(src/host/Linux-SGX) + else() + message("PAL target: Linux") + add_subdirectory(src/host/Linux) + endif() +endif()