Files
compiler-explorer/examples/cmakescript/default.cmake
Vicente Bolea 20d2852138 lang: add cmakescript language (#5815)
Fixes #5502 

In this PR I make an early attempt to add the CMakeScript as a language
in compiler-explorer. I will be fantastic having this since CMake is one
of the most used build system. Having an cmake interpreter in the web
would probe truly useful for teams and individuals, it will be a
fantastic way to share snippets of cmakescript and show how they are
executed with different cmake versions.

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-04 21:03:50 -06:00

14 lines
362 B
CMake

# CMake can execute standalone CMake scripts with the -P parameter
# in the following manner: `cmake -P script.cmake`
set(flags ON OFF ON OFF OFF ON)
set(num_activated_flags)
foreach (value IN LISTS flags)
if (value)
math(EXPR num_activated_flags "${num_activated_flags} + 1")
endif()
endforeach()
message("Activated Options: ${num_activated_flags}")