Fix indent

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-09-05 07:44:17 +02:00
parent d78e925d49
commit c6a72e4ffb

View File

@@ -1,48 +1,47 @@
# #
# This file is part of the Pico HSM distribution (https://github.com/polhenarejos/pico-hsm). # This file is part of the Pico HSM distribution (https://github.com/polhenarejos/pico-hsm).
# Copyright (c) 2022 Pol Henarejos. # Copyright (c) 2022 Pol Henarejos.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3. # the Free Software Foundation, version 3.
# #
# This program is distributed in the hope that it will be useful, but # This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
if(ESP_PLATFORM) if(ESP_PLATFORM)
set(EXTRA_COMPONENT_DIRS src pico-keys-sdk/src) set(EXTRA_COMPONENT_DIRS src pico-keys-sdk/src)
include($ENV{IDF_PATH}/tools/cmake/project.cmake) include($ENV{IDF_PATH}/tools/cmake/project.cmake)
else() else()
if(ENABLE_EMULATION) if(NOT ENABLE_EMULATION)
else() include(pico_sdk_import.cmake)
include(pico_sdk_import.cmake) endif()
endif()
project(pico_hsm C CXX ASM) project(pico_hsm C CXX ASM)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
if(NOT ENABLE_EMULATION) if(NOT ENABLE_EMULATION)
pico_sdk_init() pico_sdk_init()
endif() endif()
if (NOT DEFINED __FOR_CI) if(NOT DEFINED __FOR_CI)
set(__FOR_CI 0) set(__FOR_CI 0)
endif() endif()
if (__FOR_CI) if(__FOR_CI)
add_definitions(-D__FOR_CI) add_definitions(-D__FOR_CI)
endif() endif()
add_executable(pico_hsm) add_executable(pico_hsm)
endif() endif()
set(SOURCES ${SOURCES} set(SOURCES ${SOURCES}
${CMAKE_CURRENT_LIST_DIR}/src/hsm/sc_hsm.c ${CMAKE_CURRENT_LIST_DIR}/src/hsm/sc_hsm.c
@@ -76,8 +75,7 @@ set(SOURCES ${SOURCES}
${CMAKE_CURRENT_LIST_DIR}/src/hsm/cvc.c ${CMAKE_CURRENT_LIST_DIR}/src/hsm/cvc.c
${CMAKE_CURRENT_LIST_DIR}/src/hsm/files.c ${CMAKE_CURRENT_LIST_DIR}/src/hsm/files.c
${CMAKE_CURRENT_LIST_DIR}/src/hsm/kek.c ${CMAKE_CURRENT_LIST_DIR}/src/hsm/kek.c
)
)
set(USB_ITF_CCID 1) set(USB_ITF_CCID 1)
set(USB_ITF_WCID 1) set(USB_ITF_WCID 1)
include(pico-keys-sdk/pico_keys_sdk_import.cmake) include(pico-keys-sdk/pico_keys_sdk_import.cmake)
@@ -90,22 +88,22 @@ endif()
set(INCLUDES ${INCLUDES} set(INCLUDES ${INCLUDES}
${CMAKE_CURRENT_LIST_DIR}/src/hsm ${CMAKE_CURRENT_LIST_DIR}/src/hsm
)
if(NOT ESP_PLATFORM)
target_sources(pico_hsm PUBLIC ${SOURCES})
target_include_directories(pico_hsm PUBLIC ${INCLUDES})
target_compile_options(pico_hsm PUBLIC
-Wall
) )
if (NOT MSVC) if(NOT ESP_PLATFORM)
target_sources(pico_hsm PUBLIC ${SOURCES})
target_include_directories(pico_hsm PUBLIC ${INCLUDES})
target_compile_options(pico_hsm PUBLIC
-Wall
)
if(NOT MSVC)
target_compile_options(pico_hsm PUBLIC target_compile_options(pico_hsm PUBLIC
-Werror -Werror
) )
endif() endif()
if(ENABLE_EMULATION) if(ENABLE_EMULATION)
if (NOT MSVC) if(NOT MSVC)
target_compile_options(pico_hsm PUBLIC target_compile_options(pico_hsm PUBLIC
-fdata-sections -fdata-sections
-ffunction-sections -ffunction-sections
@@ -125,10 +123,9 @@ if(ENABLE_EMULATION)
target_link_options(pico_hsm PUBLIC target_link_options(pico_hsm PUBLIC
-Wl,--gc-sections -Wl,--gc-sections
) )
endif (APPLE) endif(APPLE)
target_link_libraries(pico_hsm PRIVATE pthread m) target_link_libraries(pico_hsm PRIVATE pthread m)
else() else()
target_link_libraries(pico_hsm PRIVATE pico_keys_sdk pico_stdlib pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id pico_aon_timer tinyusb_device tinyusb_board)
target_link_libraries(pico_hsm PRIVATE pico_keys_sdk pico_stdlib pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id pico_aon_timer tinyusb_device tinyusb_board) endif()
endif()
endif() endif()