1#include <cstdio>
2#include <cstdlib>
3
4// This file is instantiated by CMake.
5// DEFINITIONS below is replaced with a set of lines like so:
6//   #ifdef __SSE2__
7//     "SSE2",
8//   #endif
9//
10// This allows for introspection of compiler definitions.
11// The output of the program is a single line of semi colon separated feature
12// names.
13
14// MSVC is using a different set of preprocessor definitions for
15// SSE and SSE2, see _M_IX86_FP in
16// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
17
18int main(int, char **) {
19  const char *strings[] = {
20      @DEFINITIONS@
21  };
22  const size_t size = sizeof(strings) / sizeof(strings[0]);
23  for (size_t i = 0; i < size; ++i) {
24    if (i)
25      putchar(';');
26    fputs(strings[i], stdout);
27  }
28  return EXIT_SUCCESS;
29}
30