2022-09-02 16:17:10 +00:00
|
|
|
#
|
|
|
|
# This file is part of the Pico FIDO distribution (https://github.com/polhenarejos/pico-fido).
|
|
|
|
# Copyright (c) 2022 Pol Henarejos.
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# the Free Software Foundation, version 3.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
|
|
|
|
include(pico_sdk_import.cmake)
|
|
|
|
|
|
|
|
project(pico_fido C CXX ASM)
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
pico_sdk_init()
|
|
|
|
|
|
|
|
add_executable(pico_fido)
|
|
|
|
|
2022-09-23 07:21:32 +00:00
|
|
|
option(ENABLE_UP_BUTTON "Enable/disable user presence button" ON)
|
|
|
|
if(ENABLE_UP_BUTTON)
|
|
|
|
add_definitions(-DENABLE_UP_BUTTON=1)
|
|
|
|
message("Enabling user presence with button")
|
|
|
|
else()
|
|
|
|
add_definitions(-DENABLE_UP_BUTTON=0)
|
|
|
|
message("Disabling user presence with button")
|
|
|
|
endif(ENABLE_UP_BUTTON)
|
|
|
|
|
2022-09-23 14:46:16 +00:00
|
|
|
option(ENABLE_POWER_ON_RESET "Enable/disable power cycle on reset" ON)
|
|
|
|
if(ENABLE_POWER_ON_RESET)
|
|
|
|
add_definitions(-DENABLE_POWER_ON_RESET=1)
|
|
|
|
message("Enabling power cycle on reset")
|
|
|
|
else()
|
|
|
|
add_definitions(-DENABLE_POWER_ON_RESET=0)
|
|
|
|
message("Disabling power cycle on reset")
|
|
|
|
endif(ENABLE_POWER_ON_RESET)
|
|
|
|
|
2022-09-02 16:17:10 +00:00
|
|
|
target_sources(pico_fido PUBLIC
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/fido.c
|
2022-09-02 16:36:14 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/files.c
|
2022-09-02 16:17:48 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cmd_register.c
|
2022-09-05 14:48:18 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cmd_authenticate.c
|
2022-09-05 15:30:17 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cmd_version.c
|
2022-09-15 12:16:12 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cbor.c
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cbor_reset.c
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cbor_get_info.c
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cbor_make_credential.c
|
2022-09-15 22:48:58 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/known_apps.c
|
2022-09-19 15:20:52 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cbor_client_pin.c
|
2022-09-20 15:31:09 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/credential.c
|
2022-09-20 22:00:51 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cbor_get_assertion.c
|
2022-09-28 10:02:52 +00:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/cbor_selection.c
|
2022-09-02 16:17:10 +00:00
|
|
|
)
|
|
|
|
set(HSM_DRIVER "hid")
|
|
|
|
include(pico-hsm-sdk/pico_hsm_sdk_import.cmake)
|
|
|
|
|
|
|
|
target_include_directories(pico_fido PUBLIC
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/src/fido
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_options(pico_fido PUBLIC
|
|
|
|
-Wall
|
|
|
|
-Werror
|
2022-09-16 09:19:20 +00:00
|
|
|
)
|
|
|
|
string(FIND ${CMAKE_C_COMPILER} ":" COMPILER_COLON)
|
|
|
|
if (${COMPILER_COLON} GREATER_EQUAL 0)
|
|
|
|
target_compile_options(pico_fido PUBLIC
|
|
|
|
-Wno-error=use-after-free
|
|
|
|
)
|
|
|
|
endif()
|
2022-09-02 16:17:10 +00:00
|
|
|
|
|
|
|
pico_add_extra_outputs(pico_fido)
|
|
|
|
|
|
|
|
target_link_libraries(pico_fido PRIVATE pico_hsm_sdk pico_stdlib pico_multicore hardware_flash hardware_sync hardware_adc pico_unique_id hardware_rtc tinyusb_device tinyusb_board)
|