Skip to content

Commit

Permalink
Use lower-case function name convention in Cmake files
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Teoh <[email protected]>
  • Loading branch information
alexteoh-intel authored and jyao1 committed Jun 5, 2024
1 parent f969c2c commit 2f0da8f
Show file tree
Hide file tree
Showing 101 changed files with 1,205 additions and 1,205 deletions.
1,106 changes: 553 additions & 553 deletions CMakeLists.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions library/spdm_common_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include)
include_directories(${LIBSPDM_DIR}/include)

SET(src_spdm_common_lib
set(src_spdm_common_lib
libspdm_com_context_data.c
libspdm_com_context_data_session.c
libspdm_com_crypto_service.c
Expand All @@ -12,4 +12,4 @@ SET(src_spdm_common_lib
libspdm_com_msg_log.c
)

ADD_LIBRARY(spdm_common_lib STATIC ${src_spdm_common_lib})
add_library(spdm_common_lib STATIC ${src_spdm_common_lib})
8 changes: 4 additions & 4 deletions library/spdm_crypt_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include)
INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/os_stub)
include_directories(${LIBSPDM_DIR}/include)
include_directories(${LIBSPDM_DIR}/os_stub)

SET(src_spdm_crypt_lib
set(src_spdm_crypt_lib
libspdm_crypt_hash.c
libspdm_crypt_hmac.c
libspdm_crypt_hkdf.c
Expand All @@ -26,4 +26,4 @@ SET(src_spdm_crypt_lib
fips/libspdm_selftest_eddsa.c
)

ADD_LIBRARY(spdm_crypt_lib STATIC ${src_spdm_crypt_lib})
add_library(spdm_crypt_lib STATIC ${src_spdm_crypt_lib})
6 changes: 3 additions & 3 deletions library/spdm_requester_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include)
include_directories(${LIBSPDM_DIR}/include)

SET(src_spdm_requester_lib
set(src_spdm_requester_lib
libspdm_req_challenge.c
libspdm_req_common.c
libspdm_req_communication.c
Expand Down Expand Up @@ -33,4 +33,4 @@ SET(src_spdm_requester_lib
libspdm_req_vendor_request.c
)

ADD_LIBRARY(spdm_requester_lib STATIC ${src_spdm_requester_lib})
add_library(spdm_requester_lib STATIC ${src_spdm_requester_lib})
6 changes: 3 additions & 3 deletions library/spdm_responder_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
include_directories(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/os_stub
)

SET(src_spdm_responder_lib
set(src_spdm_responder_lib
libspdm_rsp_algorithms.c
libspdm_rsp_capabilities.c
libspdm_rsp_certificate.c
Expand Down Expand Up @@ -38,4 +38,4 @@ SET(src_spdm_responder_lib
libspdm_rsp_vendor_response.c
)

ADD_LIBRARY(spdm_responder_lib STATIC ${src_spdm_responder_lib})
add_library(spdm_responder_lib STATIC ${src_spdm_responder_lib})
6 changes: 3 additions & 3 deletions library/spdm_secured_message_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include)
include_directories(${LIBSPDM_DIR}/include)

SET(src_spdm_secured_message_lib
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
)

ADD_LIBRARY(spdm_secured_message_lib STATIC ${src_spdm_secured_message_lib})
add_library(spdm_secured_message_lib STATIC ${src_spdm_secured_message_lib})
6 changes: 3 additions & 3 deletions library/spdm_transport_mctp_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include)
include_directories(${LIBSPDM_DIR}/include)

SET(src_spdm_transport_mctp_lib
set(src_spdm_transport_mctp_lib
libspdm_mctp_common.c
libspdm_mctp_mctp.c
)

ADD_LIBRARY(spdm_transport_mctp_lib STATIC ${src_spdm_transport_mctp_lib})
add_library(spdm_transport_mctp_lib STATIC ${src_spdm_transport_mctp_lib})
6 changes: 3 additions & 3 deletions library/spdm_transport_pcidoe_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include)
include_directories(${LIBSPDM_DIR}/include)

SET(src_spdm_transport_pcidoe_lib
set(src_spdm_transport_pcidoe_lib
libspdm_doe_common.c
libspdm_doe_pcidoe.c
)

ADD_LIBRARY(spdm_transport_pcidoe_lib STATIC ${src_spdm_transport_pcidoe_lib})
add_library(spdm_transport_pcidoe_lib STATIC ${src_spdm_transport_pcidoe_lib})
4 changes: 2 additions & 2 deletions os_stub/armbuild_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5)

SET(src_armbuild_lib
set(src_armbuild_lib
div64.c
)

ADD_LIBRARY(armbuild_lib STATIC ${src_armbuild_lib})
add_library(armbuild_lib STATIC ${src_armbuild_lib})
12 changes: 6 additions & 6 deletions os_stub/cryptlib_mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
ADD_COMPILE_OPTIONS(-Wno-incompatible-pointer-types -Wno-pointer-sign)
add_compile_options(-Wno-incompatible-pointer-types -Wno-pointer-sign)
endif()

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
include_directories(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/include/hal
${LIBSPDM_DIR}/os_stub/include
${LIBSPDM_DIR}/os_stub
Expand All @@ -15,7 +15,7 @@ INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/os_stub/mbedtlslib/mbedtls/include/mbedtls
)

SET(src_cryptlib_mbedtls
set(src_cryptlib_mbedtls
cipher/aead_aes_gcm.c
cipher/aead_chacha20_poly1305.c
cipher/aead_sm4_gcm.c
Expand All @@ -42,14 +42,14 @@ SET(src_cryptlib_mbedtls
sys_call/crt_wrapper_host.c
)

ADD_LIBRARY(cryptlib_mbedtls STATIC ${src_cryptlib_mbedtls})
add_library(cryptlib_mbedtls STATIC ${src_cryptlib_mbedtls})
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if((TOOLCHAIN STREQUAL "CBMC") OR (TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022"))
TARGET_COMPILE_OPTIONS(cryptlib_mbedtls PRIVATE /wd4090 /wd4200)
target_compile_options(cryptlib_mbedtls PRIVATE /wd4090 /wd4200)
endif()
endif()

if(MBEDTLS_CONFIG_FILE)
else()
TARGET_COMPILE_DEFINITIONS(cryptlib_mbedtls PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
target_compile_definitions(cryptlib_mbedtls PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
endif()
8 changes: 4 additions & 4 deletions os_stub/cryptlib_null/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
cmake_minimum_required(VERSION 3.5)

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
ADD_COMPILE_OPTIONS(-Wno-incompatible-pointer-types -Wno-pointer-sign)
add_compile_options(-Wno-incompatible-pointer-types -Wno-pointer-sign)
endif()

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/os_stub/cryptlib_null
include_directories(${LIBSPDM_DIR}/os_stub/cryptlib_null
${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/include/hal
${LIBSPDM_DIR}/os_stub/include
)

SET(src_cryptlib_null
set(src_cryptlib_null
cipher/aead_aes_gcm.c
cipher/aead_chacha20_poly1305.c
cipher/aead_sm4_gcm.c
Expand All @@ -35,4 +35,4 @@ SET(src_cryptlib_null
rand/rand.c
)

ADD_LIBRARY(cryptlib_null STATIC ${src_cryptlib_null})
add_library(cryptlib_null STATIC ${src_cryptlib_null})
22 changes: 11 additions & 11 deletions os_stub/cryptlib_openssl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
include_directories(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/include/hal
${LIBSPDM_DIR}/os_stub/include
${LIBSPDM_DIR}/os_stub/cryptlib_openssl
Expand All @@ -12,22 +12,22 @@ INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
)

if(ARCH STREQUAL "x64")
ADD_COMPILE_OPTIONS(-DLIBSPDM_CPU_X64)
add_compile_options(-DLIBSPDM_CPU_X64)
elseif(ARCH STREQUAL "ia32")
ADD_COMPILE_OPTIONS(-DLIBSPDM_CPU_IA32)
add_compile_options(-DLIBSPDM_CPU_IA32)
elseif(ARCH STREQUAL "aarch64")
ADD_COMPILE_OPTIONS(-DLIBSPDM_CPU_AARCH64)
add_compile_options(-DLIBSPDM_CPU_AARCH64)
elseif(ARCH STREQUAL "riscv32")
ADD_COMPILE_OPTIONS(-DLIBSPDM_CPU_RISCV32)
add_compile_options(-DLIBSPDM_CPU_RISCV32)
elseif(ARCH STREQUAL "riscv64")
ADD_COMPILE_OPTIONS(-DLIBSPDM_CPU_RISCV64)
add_compile_options(-DLIBSPDM_CPU_RISCV64)
elseif((ARCH STREQUAL "arm") OR (ARCH STREQUAL "aarch64"))
ADD_COMPILE_OPTIONS(-DLIBSPDM_CPU_ARM)
add_compile_options(-DLIBSPDM_CPU_ARM)
else()
MESSAGE(FATAL_ERROR "Unknown ARCH")
message(FATAL_ERROR "Unknown ARCH")
endif()

SET(src_cryptlib_openssl
set(src_cryptlib_openssl
cipher/aead_aes_gcm.c
cipher/aead_chacha20_poly1305.c
cipher/aead_sm4_gcm.c
Expand All @@ -53,5 +53,5 @@ SET(src_cryptlib_openssl
sys_call/crt_wrapper_host.c
)

ADD_LIBRARY(cryptlib_openssl STATIC ${src_cryptlib_openssl})
TARGET_COMPILE_OPTIONS(cryptlib_openssl PRIVATE ${OPENSSL_FLAGS})
add_library(cryptlib_openssl STATIC ${src_cryptlib_openssl})
target_compile_options(cryptlib_openssl PRIVATE ${OPENSSL_FLAGS})
6 changes: 3 additions & 3 deletions os_stub/debuglib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
include_directories(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/include/hal)

SET(src_debuglib
set(src_debuglib
debuglib.c
)

ADD_LIBRARY(debuglib STATIC ${src_debuglib})
add_library(debuglib STATIC ${src_debuglib})
6 changes: 3 additions & 3 deletions os_stub/debuglib_null/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
include_directories(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/include/hal)

SET(src_debuglib_null
set(src_debuglib_null
debuglib.c
)

ADD_LIBRARY(debuglib_null STATIC ${src_debuglib_null})
add_library(debuglib_null STATIC ${src_debuglib_null})
6 changes: 3 additions & 3 deletions os_stub/malloclib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.5)

INCLUDE_DIRECTORIES(${LIBSPDM_DIR}/include
include_directories(${LIBSPDM_DIR}/include
${LIBSPDM_DIR}/include/hal)

SET(src_malloclib
set(src_malloclib
malloclib.c
)

ADD_LIBRARY(malloclib STATIC ${src_malloclib})
add_library(malloclib STATIC ${src_malloclib})
42 changes: 21 additions & 21 deletions os_stub/mbedtlslib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,80 +12,80 @@ endif()
function(link_to_source base_name)
endfunction(link_to_source)

ADD_SUBDIRECTORY(${CMAKE_CURRENT_LIST_DIR}/mbedtls/library)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/mbedtls/library)

# mbedtls

if(MBEDTLS_CONFIG_FILE)
else()
TARGET_COMPILE_DEFINITIONS(mbedtls PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
target_compile_definitions(mbedtls PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
endif()
TARGET_INCLUDE_DIRECTORIES(mbedtls PRIVATE
target_include_directories(mbedtls PRIVATE
${CMAKE_CURRENT_LIST_DIR}/include/mbedtls
${CMAKE_CURRENT_LIST_DIR}/mbedtls/include
${CMAKE_CURRENT_LIST_DIR}/mbedtls/library
)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if((TOOLCHAIN STREQUAL "CBMC") OR (TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022"))
TARGET_COMPILE_OPTIONS(mbedtls PRIVATE /wd4090 /wd4244 /wd4132 /wd4245 /wd4310 /wd4701 /wd4127 /wd4204 /wd4702 /wd4200 /wd4389)
target_compile_options(mbedtls PRIVATE /wd4090 /wd4244 /wd4132 /wd4245 /wd4310 /wd4701 /wd4127 /wd4204 /wd4702 /wd4200 /wd4389)
endif()
else()
TARGET_COMPILE_OPTIONS(mbedtls PRIVATE -Wno-cast-qual ${MBEDTLS_FLAGS})
target_compile_options(mbedtls PRIVATE -Wno-cast-qual ${MBEDTLS_FLAGS})
endif()
if(ARCH STREQUAL "x64")
TARGET_COMPILE_DEFINITIONS(mbedtls PRIVATE -DEFIx64)
target_compile_definitions(mbedtls PRIVATE -DEFIx64)
elseif(ARCH STREQUAL "ia32")
TARGET_COMPILE_DEFINITIONS(mbedtls PRIVATE -DEFI32)
target_compile_definitions(mbedtls PRIVATE -DEFI32)
endif()

# mbedx509
if(MBEDTLS_CONFIG_FILE)
else()
TARGET_COMPILE_DEFINITIONS(mbedx509 PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
target_compile_definitions(mbedx509 PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
endif()
TARGET_INCLUDE_DIRECTORIES(mbedx509 PRIVATE
target_include_directories(mbedx509 PRIVATE
${CMAKE_CURRENT_LIST_DIR}/include/mbedtls
${CMAKE_CURRENT_LIST_DIR}/mbedtls/include
${CMAKE_CURRENT_LIST_DIR}/mbedtls/library
)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if((TOOLCHAIN STREQUAL "CBMC") OR (TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022"))
TARGET_COMPILE_OPTIONS(mbedx509 PRIVATE /wd4090 /wd4244 /wd4132 /wd4245 /wd4310 /wd4701 /wd4127 /wd4204 /wd4702 /wd4200 /wd4389)
target_compile_options(mbedx509 PRIVATE /wd4090 /wd4244 /wd4132 /wd4245 /wd4310 /wd4701 /wd4127 /wd4204 /wd4702 /wd4200 /wd4389)
endif()
else()
TARGET_COMPILE_OPTIONS(mbedx509 PRIVATE -Wno-cast-qual ${MBEDTLS_FLAGS})
target_compile_options(mbedx509 PRIVATE -Wno-cast-qual ${MBEDTLS_FLAGS})
endif()
if(ARCH STREQUAL "x64")
TARGET_COMPILE_DEFINITIONS(mbedx509 PRIVATE -DEFIx64)
target_compile_definitions(mbedx509 PRIVATE -DEFIx64)
elseif(ARCH STREQUAL "ia32")
TARGET_COMPILE_DEFINITIONS(mbedx509 PRIVATE -DEFI32)
target_compile_definitions(mbedx509 PRIVATE -DEFI32)
endif()

# mbedcrypto
if(MBEDTLS_CONFIG_FILE)
else()
TARGET_COMPILE_DEFINITIONS(mbedcrypto PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
target_compile_definitions(mbedcrypto PRIVATE -DMBEDTLS_CONFIG_FILE=<libspdm_mbedtls_config.h>)
endif()
TARGET_INCLUDE_DIRECTORIES(mbedcrypto PRIVATE
target_include_directories(mbedcrypto PRIVATE
${CMAKE_CURRENT_LIST_DIR}/include/mbedtls
${CMAKE_CURRENT_LIST_DIR}/mbedtls/include
${CMAKE_CURRENT_LIST_DIR}/mbedtls/library
)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if((TOOLCHAIN STREQUAL "CBMC") OR (TOOLCHAIN STREQUAL "VS2015") OR (TOOLCHAIN STREQUAL "VS2019") OR (TOOLCHAIN STREQUAL "VS2022"))
TARGET_COMPILE_OPTIONS(mbedcrypto PRIVATE /wd4090 /wd4244 /wd4132 /wd4245 /wd4310 /wd4701 /wd4127 /wd4204 /wd4702 /wd4200 /wd4389)
target_compile_options(mbedcrypto PRIVATE /wd4090 /wd4244 /wd4132 /wd4245 /wd4310 /wd4701 /wd4127 /wd4204 /wd4702 /wd4200 /wd4389)
endif()
else()
TARGET_COMPILE_OPTIONS(mbedcrypto PRIVATE -Wno-cast-qual ${MBEDTLS_FLAGS})
target_compile_options(mbedcrypto PRIVATE -Wno-cast-qual ${MBEDTLS_FLAGS})
endif()
if(ARCH STREQUAL "x64")
TARGET_COMPILE_DEFINITIONS(mbedcrypto PRIVATE -DEFIx64)
target_compile_definitions(mbedcrypto PRIVATE -DEFIx64)
elseif(ARCH STREQUAL "ia32")
TARGET_COMPILE_DEFINITIONS(mbedcrypto PRIVATE -DEFI32)
target_compile_definitions(mbedcrypto PRIVATE -DEFI32)
endif()

ADD_LIBRARY(mbedtlslib INTERFACE)
TARGET_LINK_LIBRARIES(mbedtlslib INTERFACE
add_library(mbedtlslib INTERFACE)
target_link_libraries(mbedtlslib INTERFACE
mbedx509
mbedcrypto
)
Loading

0 comments on commit 2f0da8f

Please sign in to comment.