From 93f584e5ef240df9459ee746c3b0f165161a51d3 Mon Sep 17 00:00:00 2001 From: Michael D Starch Date: Thu, 6 Feb 2025 12:53:10 -0800 Subject: [PATCH] Create empty library to avoid 3.16 limitations on interface libs --- Fw/Types/CMakeLists.txt | 2 +- cmake/module.cmake | 1 + cmake/valid-empty.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 cmake/valid-empty.cpp diff --git a/Fw/Types/CMakeLists.txt b/Fw/Types/CMakeLists.txt index 27dce5ae95..01cd6474c7 100644 --- a/Fw/Types/CMakeLists.txt +++ b/Fw/Types/CMakeLists.txt @@ -38,5 +38,5 @@ register_fprime_ut() add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/GTest") # Create an empty interface library and use it to register an implementation -add_library(snprintf-format INTERFACE) +add_library(snprintf-format ${VALID_EMPTY}) register_fprime_implementation(Fw_StringFormat snprintf-format "${CMAKE_CURRENT_LIST_DIR}/snprintf_format.cpp") diff --git a/cmake/module.cmake b/cmake/module.cmake index e8ba77b41d..6078ec4d0d 100644 --- a/cmake/module.cmake +++ b/cmake/module.cmake @@ -11,6 +11,7 @@ include_guard() include(target/target) include(implementation) set(EMPTY "${FPRIME_FRAMEWORK_PATH}/cmake/empty.cpp") +set(VALID_EMPTY "${FPRIME_FRAMEWORK_PATH}/cmake/valid-empty.cpp") #### # Function `generate_base_module_properties`: diff --git a/cmake/valid-empty.cpp b/cmake/valid-empty.cpp new file mode 100644 index 0000000000..1c610b86f5 --- /dev/null +++ b/cmake/valid-empty.cpp @@ -0,0 +1 @@ +static constexpr bool __INTENTIONALLY_UNUSED_SYMBOL__ = false;