|
1 | 1 | cmake_minimum_required(VERSION 3.19.0) |
2 | 2 | set(CMAKE_MESSAGE_LOG_LEVEL debug) |
3 | 3 |
|
4 | | -if("${CMAKE_BUILD_PLATFORM}" STREQUAL "Device") |
5 | | - message("Device platform selected") |
6 | | - set(CMAKE_TOOLCHAIN_FILE utilities/cmake/arm-none-eabi-gcc.cmake) |
7 | | - set(PROJECT Cypherock-${FIRMWARE_TYPE}) |
8 | | -elseif("${CMAKE_BUILD_PLATFORM}" STREQUAL "Simulator") |
9 | | - message("Simulator platform selected") |
10 | | - set(PROJECT Cypherock_Simulator) |
11 | | -else() |
12 | | - message(WARNING "No platform specified defaulting to Simulator. Specify using -DCMAKE_BUILD_PLATFORM=<Type> Type can be Device or Simulator") |
13 | | - set(PROJECT Cypherock_Simulator) |
14 | | -endif() |
15 | | - |
16 | | -# Define all options upfront, including BTC_ONLY |
17 | | -OPTION(DEV_SWITCH "Additional features/logs to aid developers" OFF) |
18 | | -OPTION(UNIT_TESTS_SWITCH "Compile build for main firmware or unit tests" OFF) |
19 | | -OPTION(BTC_ONLY "Build firmware for Bitcoin only" OFF) |
20 | | - |
21 | 4 | # Add vendor specific compile definitions |
22 | 5 | if ("${VENDOR}" STREQUAL "Odix") |
| 6 | + message("Vendor Odix") |
23 | 7 | add_compile_definitions(VENDOR_NAME="Odix Wallet") |
24 | 8 | add_compile_definitions(VENDOR_COMPANION_APP="Odix") |
25 | 9 | add_compile_definitions(VENDOR_DEVICE_NAME="Odix Wallet") |
26 | 10 | add_compile_definitions(VENDOR_COMPANY_NAME"Odix") |
27 | | - set(PROJECT ${PROJECT}-Odix) |
| 11 | + set(PROJECT Odix) |
28 | 12 | add_compile_definitions(VENDOR_ID=1) |
29 | 13 | else() |
| 14 | + message("Vendor Cypherock") |
30 | 15 | add_compile_definitions(VENDOR_NAME="Cypherock X1 Wallet") |
31 | 16 | add_compile_definitions(VENDOR_COMPANION_APP="cySync") |
32 | 17 | add_compile_definitions(VENDOR_DEVICE_NAME="Cypherock X1") |
33 | 18 | add_compile_definitions(VENDOR_COMPANY_NAME"Cypherock") |
34 | 19 | add_compile_definitions(VENDOR_ID=0) |
| 20 | + set(PROJECT Cypherock) |
35 | 21 | endif() |
36 | 22 |
|
| 23 | +if("${CMAKE_BUILD_PLATFORM}" STREQUAL "Device") |
| 24 | + message("Device platform selected") |
| 25 | + set(CMAKE_TOOLCHAIN_FILE utilities/cmake/arm-none-eabi-gcc.cmake) |
| 26 | + set(PROJECT ${PROJECT}-${FIRMWARE_TYPE}) |
| 27 | +elseif("${CMAKE_BUILD_PLATFORM}" STREQUAL "Simulator") |
| 28 | + message("Simulator platform selected") |
| 29 | + set(PROJECT ${PROJECT}_Simulator) |
| 30 | +else() |
| 31 | + message(WARNING "No platform specified defaulting to Simulator. Specify using -DCMAKE_BUILD_PLATFORM=<Type> Type can be Device or Simulator") |
| 32 | + set(PROJECT ${PROJECT}_Simulator) |
| 33 | +endif() |
| 34 | + |
| 35 | +# Define all options upfront, including BTC_ONLY |
| 36 | +OPTION(DEV_SWITCH "Additional features/logs to aid developers" OFF) |
| 37 | +OPTION(UNIT_TESTS_SWITCH "Compile build for main firmware or unit tests" OFF) |
| 38 | +OPTION(BTC_ONLY "Build firmware for Bitcoin only" OFF) |
| 39 | + |
37 | 40 | # Append -BTC to project name if BTC_ONLY is enabled |
38 | 41 | if (BTC_ONLY) |
39 | 42 | set(PROJECT ${PROJECT}-BTC) |
|
0 commit comments