|
@@ -23,6 +23,20 @@ set(${CMAKE_PROJECT_NAME}_ALL_SRCS main.ino Storage.cpp AppCore.cpp)
|
23
|
23
|
set(${CMAKE_PROJECT_NAME}_SKETCH main.ino)
|
24
|
24
|
generate_arduino_firmware(${CMAKE_PROJECT_NAME})
|
25
|
25
|
|
|
26
|
+add_definitions(-DAPP_CORE_VERSION=1.0.0)
|
|
27
|
+
|
|
28
|
+execute_process(
|
|
29
|
+ COMMAND
|
|
30
|
+ git rev-parse --short HEAD
|
|
31
|
+ RESULT_VARIABLE
|
|
32
|
+ SHORT_HASH_RESULT
|
|
33
|
+ OUTPUT_VARIABLE
|
|
34
|
+ SHORT_HASH
|
|
35
|
+)
|
|
36
|
+string(REGEX REPLACE "\n$" "" SHORT_HASH "${SHORT_HASH}")
|
|
37
|
+message(STATUS "SHORT_HASH=${SHORT_HASH}")
|
|
38
|
+add_definitions(-DAPP_CORE_COMMIT=${SHORT_HASH})
|
|
39
|
+
|
26
|
40
|
if (CMAKE_BUILD_TYPE MATCHES "Debug")
|
27
|
41
|
message(STATUS "Debug build detected. Enabling logs.")
|
28
|
42
|
add_definitions(-DAPP_CORE_LOGS=1)
|