From fec0d5df49e959bea0b673ada70f00f336ea564a Mon Sep 17 00:00:00 2001 From: Viatorus Date: Sun, 21 Apr 2024 13:42:54 +0200 Subject: [PATCH] test case for freestanding --- test/compile_test/CMakeLists.txt | 11 ++++++++++- test/compile_test/compile.cpp | 7 +++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/test/compile_test/CMakeLists.txt b/test/compile_test/CMakeLists.txt index a5d71fe..885b482 100644 --- a/test/compile_test/CMakeLists.txt +++ b/test/compile_test/CMakeLists.txt @@ -10,7 +10,7 @@ if (PROJECT_IS_TOP_LEVEL) enable_testing() endif () -add_executable(emio_compile ../compile_test/compile.cpp) +add_executable(emio_compile compile.cpp) target_link_libraries(emio_compile emio::emio @@ -18,4 +18,13 @@ target_link_libraries(emio_compile target_compile_features(emio_compile PRIVATE cxx_std_20) +add_executable(emio_compile_freestanding compile.cpp) + +target_link_libraries(emio_compile_freestanding + emio::emio +) + +target_compile_features(emio_compile_freestanding PRIVATE cxx_std_20) +target_compile_options(emio_compile_freestanding PRIVATE -ffreestanding) + add_folders(CompileTest) diff --git a/test/compile_test/compile.cpp b/test/compile_test/compile.cpp index b9c6a6a..041bb9a 100644 --- a/test/compile_test/compile.cpp +++ b/test/compile_test/compile.cpp @@ -1,7 +1,4 @@ -// -// Created by neubertt on 09.03.2024. -// -#include "emio/emio.hpp" +#include consteval auto created_with_span_buffer() { std::array storage{}; @@ -40,4 +37,6 @@ int main() { created_with_static_buffer(); created_with_memory_buffer(); created_with_iterator_buffer(); + + return 0; }