forked from Cypherock/x1_wallet_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
33 lines (28 loc) · 1.13 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
cmake_minimum_required(VERSION 3.15.3)
set(CMAKE_MESSAGE_LOG_LEVEL debug)
if("${CMAKE_BUILD_PLATFORM}" STREQUAL "Device")
message("Device platform selected")
set(CMAKE_TOOLCHAIN_FILE utilities/cmake/arm-none-eabi-gcc.cmake)
set(PROJECT Cypherock-${FIRMWARE_TYPE})
elseif("${CMAKE_BUILD_PLATFORM}" STREQUAL "Simulator")
message("Simulator platform selected")
set(PROJECT Cypherock_Simulator)
else()
message(WARNING "No platform specified defaulting to Simulator. Specify using -DCMAKE_BUILD_PLATFORM=<Type> Type can be Device or Simulator")
set(PROJECT Cypherock_Simulator)
endif()
project(${PROJECT})
# Populate version.c
include(utilities/cmake/version.cmake)
OPTION(DEV_SWITCH "Additional features/logs to aid developers" OFF)
OPTION(DEBUG_SWITCH "Additional functionality for extended features on X1Wallet" OFF)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
add_compile_definitions(FIRMWARE_HASH_CALC=1)
else()
add_compile_definitions(FIRMWARE_HASH_CALC=0)
endif()
if("${CMAKE_BUILD_PLATFORM}" STREQUAL "Device")
include(utilities/cmake/firmware.cmake)
else()
include(utilities/cmake/simulator.cmake)
endif()