Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:Rebuild
cvm-guest-attestation
cvm-guest-attestation.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File cvm-guest-attestation.patch of Package cvm-guest-attestation
--- CMakeLists.txt | 5 client-library/src/Attestation/AttestationClient/CMakeLists.txt | 1 client-library/src/Attestation/AttestationClient/lib/DynamicLibrary/CMakeLists.txt | 79 +++++----- client-library/src/Attestation/AttestationClient/lib/DynamicLibrary/azguestattestation.pc.in | 9 + client-library/src/Attestation/CMakeLists.txt | 9 - client-library/src/Attestation/LinuxTpm/CMakeLists.txt | 5 client-library/src/Attestation/LinuxTpm/lib/CMakeLists.txt | 26 +-- client-library/src/Attestation/LinuxTpm/staticshim/CMakeLists.txt | 7 cvm-attestation-sample-app/CMakeLists.txt | 29 +-- 9 files changed, 86 insertions(+), 84 deletions(-) --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.5) +project(cvm-guest-attestation LANGUAGES CXX) + +add_subdirectory(cvm-attestation-sample-app) +add_subdirectory(client-library/src/Attestation) --- a/client-library/src/Attestation/AttestationClient/CMakeLists.txt +++ b/client-library/src/Attestation/AttestationClient/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required(VERSION 3.5) add_subdirectory(lib) -add_subdirectory(tests) --- a/client-library/src/Attestation/AttestationClient/lib/DynamicLibrary/CMakeLists.txt +++ b/client-library/src/Attestation/AttestationClient/lib/DynamicLibrary/CMakeLists.txt @@ -1,39 +1,52 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) #MUST be same as the version in the latest entry in debian/changelog file. -project(azguestattestation VERSION 1.0.2) - -set(CMAKE_PROJECT_TARGET azguestattestation) +project(azguestattestation LANGUAGES CXX VERSION 1.0.2) +set (CMAKE_CXX_STANDARD 14) +set (MY_TARGET_API ${PROJECT_NAME}1) add_definitions (-DPLATFORM_UNIX) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/../../../LinuxTpm/include - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/../.. - ${CMAKE_CURRENT_SOURCE_DIR}/../include - ${CMAKE_SOURCE_DIR}/../external/jsoncpp-0.10.7/src - ${CMAKE_SOURCE_DIR}/../external/SnpVmReport -) - -add_library(${CMAKE_PROJECT_TARGET} SHARED ../../AttestationHelperBase64.cpp - ../../AttestationHelperJson.cpp - ../AttestationClientImpl.cpp - ../AttestationClient.cpp - ../AttestationParameters.cpp - ../TpmInfo.cpp - ../Logging.cpp - ../TpmUnseal.cpp - ../NativeConverter.cpp - ../AttestationLibUtils.cpp - ../ImdsOperations.cpp - ../IsolationInfo.cpp - ../HclReportParser.cpp - ../HttpClient.cpp - ${CMAKE_SOURCE_DIR}/../external/jsoncpp-0.10.7/src/jsoncpp.cpp) - -target_link_libraries(${CMAKE_PROJECT_TARGET} Tpm2) -target_link_libraries(${CMAKE_PROJECT_TARGET} curl) +find_package(PkgConfig REQUIRED) +pkg_check_modules(EXTERNAL REQUIRED jsoncpp libcrypto libcurl) -set_target_properties(${CMAKE_PROJECT_TARGET} PROPERTIES VERSION ${PROJECT_VERSION}) -set_target_properties(${CMAKE_PROJECT_TARGET} PROPERTIES SOVERSION 1) +add_library(${PROJECT_NAME} SHARED + ../../AttestationHelperBase64.cpp + ../../AttestationHelperJson.cpp + ../AttestationClient.cpp + ../AttestationClientImpl.cpp + ../AttestationLibUtils.cpp + ../AttestationParameters.cpp + ../HclReportParser.cpp + ../HttpClient.cpp + ../ImdsOperations.cpp + ../IsolationInfo.cpp + ../Logging.cpp + ../NativeConverter.cpp + ../TpmInfo.cpp + ../TpmUnseal.cpp + ) +target_include_directories(${PROJECT_NAME} + PRIVATE + ${EXTERNAL_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/../.. + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../external/SnpVmReport + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/../include + ) +target_link_libraries(${PROJECT_NAME} ${EXTERNAL_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} LinuxTpm) + +file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*.h) +set_target_properties(${PROJECT_NAME} PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION 1 + PUBLIC_HEADER "${HEADERS}" + ) +include(GNUInstallDirs) +configure_file(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${MY_TARGET_API} + ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) --- /dev/null +++ b/client-library/src/Attestation/AttestationClient/lib/DynamicLibrary/azguestattestation.pc.in @@ -0,0 +1,9 @@ +prefix="@CMAKE_INSTALL_PREFIX@" +libdir="${prefix}/@CMAKE_INSTALL_LIBDIR@" +includedir="${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@MY_TARGET_API@" + +Name: @PROJECT_NAME@ +Description: @PROJECT_NAME@ +Version: @PROJECT_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -l@PROJECT_NAME@ --- a/client-library/src/Attestation/CMakeLists.txt +++ b/client-library/src/Attestation/CMakeLists.txt @@ -1,13 +1,4 @@ cmake_minimum_required(VERSION 3.5) -if (NOT DEFINED ENV{CC} ) - set (CMAKE_C_COMPILER "/usr/bin/gcc-8") - set (CMAKE_CXX_COMPILER "/usr/bin/g++-8") -endif () -set (CMAKE_CXX_STANDARD 14) - -set(CMAKE_MODULE_PATH "${MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/LinuxTpm/tools/cmake") -add_definitions (-DPLATFORM_UNIX) - add_subdirectory(AttestationClient) add_subdirectory(LinuxTpm) --- a/client-library/src/Attestation/LinuxTpm/CMakeLists.txt +++ b/client-library/src/Attestation/LinuxTpm/CMakeLists.txt @@ -1,9 +1,4 @@ cmake_minimum_required(VERSION 3.5) -project(Client) - -project (TpmBuild) add_subdirectory(staticshim) add_subdirectory(lib) -add_subdirectory(testclient) -add_subdirectory(unittests) --- a/client-library/src/Attestation/LinuxTpm/lib/CMakeLists.txt +++ b/client-library/src/Attestation/LinuxTpm/lib/CMakeLists.txt @@ -1,18 +1,20 @@ cmake_minimum_required (VERSION 3.5) -set (CMAKE_PROJECT_TARGET Tpm2) -project (Linux${CMAKE_PROJECT_TARGET}) +project (LinuxTpm LANGUAGES CXX) +set (CMAKE_CXX_STANDARD 14) +add_definitions (-DPLATFORM_UNIX) -find_package(Tss2 REQUIRED) -include_directories(${TSS2_INCLUDE_DIRS}) - -include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../include) +find_package(PkgConfig REQUIRED) +pkg_check_modules(EXTERNAL REQUIRED tss2-esys tss2-mu tss2-tcti-device openssl) file(GLOB SOURCES "*.cpp") -add_library(${CMAKE_PROJECT_TARGET} ${SOURCES}) -target_link_libraries(${CMAKE_PROJECT_TARGET} ${TSS2_LIBRARIES}) -target_link_libraries(${CMAKE_PROJECT_TARGET} ssl crypto) -target_link_libraries(${CMAKE_PROJECT_TARGET} dl) -target_link_libraries(${CMAKE_PROJECT_TARGET} tss2-mu) -set_property(TARGET ${CMAKE_PROJECT_TARGET} PROPERTY POSITION_INDEPENDENT_CODE ON) +add_library(${PROJECT_NAME} STATIC ${SOURCES}) +target_include_directories(${PROJECT_NAME} + PRIVATE + ${EXTERNAL_INCLUDE_DIRS} + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/../include + ) +target_link_libraries(${PROJECT_NAME} ${EXTERNAL_LIBRARIES}) +set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) --- a/client-library/src/Attestation/LinuxTpm/staticshim/CMakeLists.txt +++ b/client-library/src/Attestation/LinuxTpm/staticshim/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(TssStaticShim) -set(CMAKE_PROJECT_TARGET TssStaticShim) - -add_library(${CMAKE_PROJECT_TARGET} mssim_shim.cpp) +project(TssStaticShim LANGUAGES CXX) +add_library(${PROJECT_NAME} STATIC mssim_shim.cpp) +set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) --- a/cvm-attestation-sample-app/CMakeLists.txt +++ b/cvm-attestation-sample-app/CMakeLists.txt @@ -1,26 +1,15 @@ cmake_minimum_required(VERSION 3.5) -project(AttestationClient) - -set(CMAKE_PROJECT_TARGET AttestationClient) +project(AttestationClient LANGUAGES CXX) add_definitions (-DPLATFORM_UNIX) -include_directories( - /usr/include/azguestattestation1 - /usr/include/jsoncpp -) - -link_directories ( - /usr/lib - /usr/lib/x86_64-linux-gnu -) - -add_executable(${CMAKE_PROJECT_TARGET} main.cpp - Utils.cpp - Logger.cpp - ) +add_executable(${PROJECT_NAME} main.cpp Utils.cpp Logger.cpp) -target_link_libraries(${CMAKE_PROJECT_TARGET} azguestattestation) -target_link_libraries(${CMAKE_PROJECT_TARGET} curl) -target_link_libraries(${CMAKE_PROJECT_TARGET} jsoncpp) \ No newline at end of file +find_package(PkgConfig REQUIRED) +pkg_check_modules(EXTERNAL REQUIRED jsoncpp libcurl) +target_include_directories(${PROJECT_NAME} PRIVATE ${EXTERNAL_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} ${EXTERNAL_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} azguestattestation) +include(GNUInstallDirs) +install(TARGETS ${PROJECT_NAME} RUNTIME)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor