From 052144cabb126efe925a96f8a0597a0f2005d206 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 23 Feb 2026 20:36:05 +0100 Subject: add metalang99 testsuite (preprocessor stress testing) --- test/external/metalang99/examples/CMakeLists.txt | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/external/metalang99/examples/CMakeLists.txt (limited to 'test/external/metalang99/examples/CMakeLists.txt') diff --git a/test/external/metalang99/examples/CMakeLists.txt b/test/external/metalang99/examples/CMakeLists.txt new file mode 100644 index 0000000..ed8e963 --- /dev/null +++ b/test/external/metalang99/examples/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.16) +project(examples LANGUAGES C) + +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + add_compile_options(-Wall -Wextra -pedantic -std=c99 + -ftrack-macro-expansion=0) +elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_options("-fmacro-backtrace-limit=1") +elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC") + # Enable a standard-conforming C99/C11 preprocessor. + add_compile_options("/std:c11") +elseif(CMAKE_C_COMPILER_ID STREQUAL "TinyCC") + add_compile_definitions(ML99_ALLOW_POOR_DIAGNOSTICS) +endif() + +include_directories(../include) + +add_executable(ackermann ackermann.c) +add_executable(assert_for_each assert_for_each.c) +add_executable(binary_tree binary_tree.c) +add_executable(demo demo.c) +add_executable(duffs_device duffs_device.c) +add_executable(factorial factorial.c) +add_executable(overload overload.c) +add_executable(rectangle rectangle.c) +add_executable(lambda_calculus lambda_calculus.c) + +foreach(TARGET ${BUILDSYSTEM_TARGETS}) + set_target_properties(TARGET PROPERTIES C_STANDARD 99 C_STANDARD_REQUIRED ON) +endforeach() -- cgit v1.2.3