Skip to content

Commit

Permalink
Associate src & inc definitions with targets in sub cmake projects
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Teoh <[email protected]>
  • Loading branch information
alexteoh-intel committed Jun 6, 2024
1 parent 2f0da8f commit c7dfd68
Show file tree
Hide file tree
Showing 23 changed files with 1,150 additions and 1,060 deletions.
24 changes: 14 additions & 10 deletions library/spdm_common_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
cmake_minimum_required(VERSION 3.5)

include_directories(${LIBSPDM_DIR}/include)
add_library(spdm_common_lib STATIC "")

set(src_spdm_common_lib
libspdm_com_context_data.c
libspdm_com_context_data_session.c
libspdm_com_crypto_service.c
libspdm_com_crypto_service_session.c
libspdm_com_opaque_data.c
libspdm_com_support.c
libspdm_com_msg_log.c
target_include_directories(spdm_common_lib
PRIVATE
${LIBSPDM_DIR}/include
)

add_library(spdm_common_lib STATIC ${src_spdm_common_lib})
target_sources(spdm_common_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libspdm_com_context_data.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_com_context_data_session.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_com_crypto_service.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_com_crypto_service_session.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_com_opaque_data.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_com_support.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_com_msg_log.c
)
52 changes: 28 additions & 24 deletions library/spdm_crypt_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
cmake_minimum_required(VERSION 3.5)

include_directories(${LIBSPDM_DIR}/include)
include_directories(${LIBSPDM_DIR}/os_stub)
add_library(spdm_crypt_lib STATIC "")

set(src_spdm_crypt_lib
libspdm_crypt_hash.c
libspdm_crypt_hmac.c
libspdm_crypt_hkdf.c
libspdm_crypt_asym.c
libspdm_crypt_cert.c
libspdm_crypt_aead.c
libspdm_crypt_dhe.c
libspdm_crypt_rng.c
fips/libspdm_selftest.c
fips/libspdm_selftest_hmac.c
fips/libspdm_selftest_aes_gcm.c
fips/libspdm_selftest_rsa_ssa.c
fips/libspdm_selftest_rsa_pss.c
fips/libspdm_selftest_hkdf.c
fips/libspdm_selftest_ecdh.c
fips/libspdm_selftest_sha2.c
fips/libspdm_selftest_sha3.c
fips/libspdm_selftest_ffdh.c
fips/libspdm_selftest_ecdsa.c
fips/libspdm_selftest_eddsa.c
target_include_directories(spdm_crypt_lib
PRIVATE
${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/os_stub
)

add_library(spdm_crypt_lib STATIC ${src_spdm_crypt_lib})
target_sources(spdm_crypt_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_hash.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_hmac.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_hkdf.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_asym.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_cert.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_aead.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_dhe.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_crypt_rng.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_hmac.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_aes_gcm.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_rsa_ssa.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_rsa_pss.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_hkdf.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_ecdh.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_sha2.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_sha3.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_ffdh.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_ecdsa.c
${CMAKE_CURRENT_LIST_DIR}/fips/libspdm_selftest_eddsa.c
)
66 changes: 35 additions & 31 deletions library/spdm_requester_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
cmake_minimum_required(VERSION 3.5)

include_directories(${LIBSPDM_DIR}/include)
add_library(spdm_requester_lib STATIC "")

set(src_spdm_requester_lib
libspdm_req_challenge.c
libspdm_req_common.c
libspdm_req_communication.c
libspdm_req_encap_certificate.c
libspdm_req_encap_challenge_auth.c
libspdm_req_encap_digests.c
libspdm_req_encap_error.c
libspdm_req_encap_key_update.c
libspdm_req_encap_request.c
libspdm_req_end_session.c
libspdm_req_finish.c
libspdm_req_get_capabilities.c
libspdm_req_get_certificate.c
libspdm_req_get_digests.c
libspdm_req_get_event_types.c
libspdm_req_get_measurements.c
libspdm_req_get_version.c
libspdm_req_handle_error_response.c
libspdm_req_heartbeat.c
libspdm_req_key_exchange.c
libspdm_req_key_update.c
libspdm_req_negotiate_algorithms.c
libspdm_req_psk_exchange.c
libspdm_req_psk_finish.c
libspdm_req_send_receive.c
libspdm_req_set_certificate.c
libspdm_req_get_csr.c
libspdm_req_vendor_request.c
target_include_directories(spdm_requester_lib
PRIVATE
${LIBSPDM_DIR}/include
)

add_library(spdm_requester_lib STATIC ${src_spdm_requester_lib})
target_sources(spdm_requester_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_challenge.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_common.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_communication.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_encap_certificate.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_encap_challenge_auth.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_encap_digests.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_encap_error.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_encap_key_update.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_encap_request.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_end_session.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_finish.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_get_capabilities.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_get_certificate.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_get_digests.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_get_event_types.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_get_measurements.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_get_version.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_handle_error_response.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_heartbeat.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_key_exchange.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_key_update.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_negotiate_algorithms.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_psk_exchange.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_psk_finish.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_send_receive.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_set_certificate.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_get_csr.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_req_vendor_request.c
)
75 changes: 39 additions & 36 deletions library/spdm_responder_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
cmake_minimum_required(VERSION 3.5)

include_directories(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/os_stub
)
add_library(spdm_responder_lib STATIC "")

set(src_spdm_responder_lib
libspdm_rsp_algorithms.c
libspdm_rsp_capabilities.c
libspdm_rsp_certificate.c
libspdm_rsp_challenge_auth.c
libspdm_rsp_common.c
libspdm_rsp_communication.c
libspdm_rsp_digests.c
libspdm_rsp_encap_challenge.c
libspdm_rsp_encap_get_certificate.c
libspdm_rsp_encap_get_digests.c
libspdm_rsp_encap_key_update.c
libspdm_rsp_encap_response.c
libspdm_rsp_end_session.c
libspdm_rsp_error.c
libspdm_rsp_finish.c
libspdm_rsp_handle_response_state.c
libspdm_rsp_heartbeat.c
libspdm_rsp_key_exchange.c
libspdm_rsp_key_update.c
libspdm_rsp_measurements.c
libspdm_rsp_psk_exchange.c
libspdm_rsp_psk_finish.c
libspdm_rsp_receive_send.c
libspdm_rsp_respond_if_ready.c
libspdm_rsp_version.c
libspdm_rsp_set_certificate.c
libspdm_rsp_supported_event_types.c
libspdm_rsp_csr.c
libspdm_rsp_chunk_send_ack.c
libspdm_rsp_chunk_get.c
libspdm_rsp_vendor_response.c
target_include_directories(spdm_responder_lib
PRIVATE
${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/os_stub
)

add_library(spdm_responder_lib STATIC ${src_spdm_responder_lib})
target_sources(spdm_responder_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_algorithms.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_capabilities.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_certificate.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_challenge_auth.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_common.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_communication.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_digests.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_encap_challenge.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_encap_get_certificate.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_encap_get_digests.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_encap_key_update.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_encap_response.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_end_session.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_error.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_finish.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_handle_response_state.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_heartbeat.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_key_exchange.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_key_update.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_measurements.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_psk_exchange.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_psk_finish.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_receive_send.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_respond_if_ready.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_version.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_set_certificate.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_supported_event_types.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_csr.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_chunk_send_ack.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_chunk_get.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_rsp_vendor_response.c
)
18 changes: 11 additions & 7 deletions library/spdm_secured_message_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
cmake_minimum_required(VERSION 3.5)

include_directories(${LIBSPDM_DIR}/include)
add_library(spdm_secured_message_lib STATIC "")

set(src_spdm_secured_message_lib
libspdm_secmes_context_data.c
libspdm_secmes_encode_decode.c
libspdm_secmes_key_exchange.c
libspdm_secmes_session.c
target_include_directories(spdm_secured_message_lib
PRIVATE
${LIBSPDM_DIR}/include
)

add_library(spdm_secured_message_lib STATIC ${src_spdm_secured_message_lib})
target_sources(spdm_secured_message_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libspdm_secmes_context_data.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_secmes_encode_decode.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_secmes_key_exchange.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_secmes_session.c
)
14 changes: 9 additions & 5 deletions library/spdm_transport_mctp_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
cmake_minimum_required(VERSION 3.5)

include_directories(${LIBSPDM_DIR}/include)
add_library(spdm_transport_mctp_lib STATIC "")

set(src_spdm_transport_mctp_lib
libspdm_mctp_common.c
libspdm_mctp_mctp.c
target_include_directories(spdm_transport_mctp_lib
PRIVATE
${LIBSPDM_DIR}/include
)

add_library(spdm_transport_mctp_lib STATIC ${src_spdm_transport_mctp_lib})
target_sources(spdm_transport_mctp_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libspdm_mctp_common.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_mctp_mctp.c
)
14 changes: 9 additions & 5 deletions library/spdm_transport_pcidoe_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
cmake_minimum_required(VERSION 3.5)

include_directories(${LIBSPDM_DIR}/include)
add_library(spdm_transport_pcidoe_lib STATIC "")

set(src_spdm_transport_pcidoe_lib
libspdm_doe_common.c
libspdm_doe_pcidoe.c
target_include_directories(spdm_transport_pcidoe_lib
PRIVATE
${LIBSPDM_DIR}/include
)

add_library(spdm_transport_pcidoe_lib STATIC ${src_spdm_transport_pcidoe_lib})
target_sources(spdm_transport_pcidoe_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libspdm_doe_common.c
${CMAKE_CURRENT_LIST_DIR}/libspdm_doe_pcidoe.c
)
9 changes: 5 additions & 4 deletions os_stub/armbuild_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.5)

set(src_armbuild_lib
div64.c
)
add_library(armbuild_lib STATIC "")

add_library(armbuild_lib STATIC ${src_armbuild_lib})
target_sources(armbuild_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/div64.c
)
Loading

0 comments on commit c7dfd68

Please sign in to comment.