@@ -30,18 +30,23 @@ if (ACCLESS_UBENCH)
3030 target_compile_definitions (${CMAKE_PROJECT_TARGET} PUBLIC ACCLESS_UBENCH)
3131endif ()
3232
33+ # Common libraries and headers that support WASM and native compilation
34+ add_subdirectory (./libs/jwt/cpp-bindings)
35+
36+ set (ACCLESS_COMMON_HEADERS
37+ ${CMAKE_CURRENT_LIST_DIR} /include
38+ ${CMAKE_CURRENT_LIST_DIR} /libs/jwt/cpp-bindings
39+ )
40+ set (ACCLESS_COMMON_LIBRARIES accless::jwt)
41+
3342if (CMAKE_SYSTEM_NAME STREQUAL "WASI" )
3443 # The WASM version of the library relies on a pre-populated sysroot as part
3544 # of a Faasm installation
3645 set (ACCLESS_LIBRARIES
3746 faasm
3847 rabe-cpp
3948 rabe
40- tless-jwt-cpp
41- tless-jwt
4249 )
43-
44- set (ACCLESS_HEADERS ${CMAKE_CURRENT_LIST_DIR} /include )
4550else ()
4651 # This lines do not suppress the warning
4752 set (MY_CUSTOM_RPATH "/usr/local/attestationcurl/lib;/usr/local/attestationssl/lib64" )
@@ -53,6 +58,9 @@ else ()
5358 /usr/local/attestationssl/lib64
5459 )
5560
61+ # The WASM version of the attestation and S3 libraries is part of Faasm
62+ # because it needs to execute (partially) outside of the WASM module
63+ # and outside of the enclave
5664 add_subdirectory (./libs/attestation)
5765 add_subdirectory (./libs/s3)
5866
@@ -64,20 +72,21 @@ else ()
6472 # Order matters: librabe-cpp must preceede librabe
6573 "/usr/local/lib/rabe/librabe-cpp.a"
6674 "/usr/local/lib/rabe/librabe.a"
67- # Same for JWT
68- "/usr/local/lib/tless-jwt/libtless-jwt-cpp.a"
69- "/usr/local/lib/tless-jwt/libtless_jwt.a"
7075 )
7176 set (ACCLESS_HEADERS
72- ${CMAKE_CURRENT_LIST_DIR} /include
7377 ${CMAKE_CURRENT_LIST_DIR} /libs
7478 "/usr/include/rabe"
75- "/usr/include/tless-jwt"
7679 )
7780endif ()
7881
79- target_include_directories (${CMAKE_PROJECT_TARGET} PUBLIC ${ACCLESS_HEADERS} )
80- target_link_libraries (${CMAKE_PROJECT_TARGET} PUBLIC ${ACCLESS_LIBRARIES} )
82+ target_include_directories (${CMAKE_PROJECT_TARGET} PUBLIC
83+ ${ACCLESS_COMMON_HEADERS}
84+ ${ACCLESS_HEADERS}
85+ )
86+ target_link_libraries (${CMAKE_PROJECT_TARGET} PUBLIC
87+ ${ACCLESS_COMMON_LIBRARIES}
88+ ${ACCLESS_LIBRARIES}
89+ )
8190
8291if (CMAKE_SYSTEM_NAME STREQUAL "WASI" )
8392 # Manually install the .imports file so that we can link against it
0 commit comments