From fdb2058d2bc8ff579883fa20f9bf108279132825 Mon Sep 17 00:00:00 2001 From: vintagepc <53943260+vintagepc@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:45:01 -0400 Subject: [PATCH] Fix test build --- CMakeLists.txt | 11 +++++++++++ src/CMakeLists.txt | 12 ------------ tests/unit/logic/cut_filament/CMakeLists.txt | 1 - tests/unit/logic/eject_filament/CMakeLists.txt | 1 - tests/unit/logic/failing_tmc/CMakeLists.txt | 1 - tests/unit/logic/feed_to_bondtech/CMakeLists.txt | 1 - tests/unit/logic/feed_to_finda/CMakeLists.txt | 1 - tests/unit/logic/homing/CMakeLists.txt | 1 - tests/unit/logic/load_filament/CMakeLists.txt | 1 - tests/unit/logic/tool_change/CMakeLists.txt | 1 - tests/unit/logic/unload_filament/CMakeLists.txt | 1 - tests/unit/logic/unload_to_finda/CMakeLists.txt | 1 - 12 files changed, 11 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c5c8b1..d450716 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,17 @@ set(CUSTOM_COMPILE_OPTIONS # Resolve BUILD_NUMBER and PROJECT_VERSION_* variables resolve_version_variables() +add_compile_definitions( + PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} + PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR} + PROJECT_VERSION_REV=${PROJECT_VERSION_REV} + PROJECT_BUILD_NUMBER=${BUILD_NUMBER} + FW_VERSION_FULL_STR="${PROJECT_VERSION_FULL}" + FW_VERSION_STR="${PROJECT_VERSION}" + FW_VERSION_SUFFIX_STR="${PROJECT_VERSION_SUFFIX}" + FW_VERSION_SUFFIX_SHORT_STR="${PROJECT_VERSION_SUFFIX_SHORT}" + ) + # Check GCC Version get_recommended_gcc_version(RECOMMENDED_TOOLCHAIN_VERSION) if(CMAKE_CROSSCOMPILING AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2449f2b..6f43568 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,18 +2,6 @@ target_sources(firmware PRIVATE application.cpp debug.cpp main.cpp registers.cpp target_link_libraries(firmware LUFA) -target_compile_definitions( - firmware - PRIVATE - PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} - PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR} - PROJECT_VERSION_REV=${PROJECT_VERSION_REV} - PROJECT_BUILD_NUMBER=${BUILD_NUMBER} - FW_VERSION_FULL_STR="${PROJECT_VERSION_FULL}" - FW_VERSION_STR="${PROJECT_VERSION}" - FW_VERSION_SUFFIX_STR="${PROJECT_VERSION_SUFFIX}" - FW_VERSION_SUFFIX_SHORT_STR="${PROJECT_VERSION_SUFFIX_SHORT}" - ) add_subdirectory(hal) add_subdirectory(logic) add_subdirectory(modules) diff --git a/tests/unit/logic/cut_filament/CMakeLists.txt b/tests/unit/logic/cut_filament/CMakeLists.txt index deb0255..e590c5c 100644 --- a/tests/unit/logic/cut_filament/CMakeLists.txt +++ b/tests/unit/logic/cut_filament/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( cut_filament_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/eject_filament/CMakeLists.txt b/tests/unit/logic/eject_filament/CMakeLists.txt index 96e4a2d..b88a7a4 100644 --- a/tests/unit/logic/eject_filament/CMakeLists.txt +++ b/tests/unit/logic/eject_filament/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( eject_filament_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/failing_tmc/CMakeLists.txt b/tests/unit/logic/failing_tmc/CMakeLists.txt index 90c1d82..735b155 100644 --- a/tests/unit/logic/failing_tmc/CMakeLists.txt +++ b/tests/unit/logic/failing_tmc/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( failing_tmc_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/feed_to_bondtech/CMakeLists.txt b/tests/unit/logic/feed_to_bondtech/CMakeLists.txt index 1252518..b6f3999 100644 --- a/tests/unit/logic/feed_to_bondtech/CMakeLists.txt +++ b/tests/unit/logic/feed_to_bondtech/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( feed_to_bondtech_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/feed_to_finda/CMakeLists.txt b/tests/unit/logic/feed_to_finda/CMakeLists.txt index 13066b8..53276b9 100644 --- a/tests/unit/logic/feed_to_finda/CMakeLists.txt +++ b/tests/unit/logic/feed_to_finda/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( feed_to_finda_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/homing/CMakeLists.txt b/tests/unit/logic/homing/CMakeLists.txt index 2b99786..af92014 100644 --- a/tests/unit/logic/homing/CMakeLists.txt +++ b/tests/unit/logic/homing/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( homing_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/load_filament/CMakeLists.txt b/tests/unit/logic/load_filament/CMakeLists.txt index 7b54465..031c9a9 100644 --- a/tests/unit/logic/load_filament/CMakeLists.txt +++ b/tests/unit/logic/load_filament/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( load_filament_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/tool_change/CMakeLists.txt b/tests/unit/logic/tool_change/CMakeLists.txt index c15640f..0db1656 100644 --- a/tests/unit/logic/tool_change/CMakeLists.txt +++ b/tests/unit/logic/tool_change/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( tool_change_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/unload_filament/CMakeLists.txt b/tests/unit/logic/unload_filament/CMakeLists.txt index 1ef983c..0c95b7c 100644 --- a/tests/unit/logic/unload_filament/CMakeLists.txt +++ b/tests/unit/logic/unload_filament/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( unload_filament_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp diff --git a/tests/unit/logic/unload_to_finda/CMakeLists.txt b/tests/unit/logic/unload_to_finda/CMakeLists.txt index b2a6828..e7372af 100644 --- a/tests/unit/logic/unload_to_finda/CMakeLists.txt +++ b/tests/unit/logic/unload_to_finda/CMakeLists.txt @@ -3,7 +3,6 @@ add_executable( unload_to_finda_tests ${CMAKE_SOURCE_DIR}/src/application.cpp ${CMAKE_SOURCE_DIR}/src/registers.cpp - ${CMAKE_SOURCE_DIR}/src/version.c ${CMAKE_SOURCE_DIR}/src/logic/command_base.cpp ${CMAKE_SOURCE_DIR}/src/logic/cut_filament.cpp ${CMAKE_SOURCE_DIR}/src/logic/eject_filament.cpp