File: strip_defines.cmake

package info (click to toggle)
khronos-opencl-clhpp 3.0~2024.10.24-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 984 kB
  • sloc: cpp: 13,856; makefile: 55; sh: 20
file content (23 lines) | stat: -rw-r--r-- 444 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cmake_minimum_required(VERSION 3.0)

if(NOT INPUT OR NOT OUTPUT)
  message(FATAL_ERROR "Usage: cmake -D INPUT=<input> -D OUTPUT=<output> -P strip_defines.cmake")
endif()

file(READ "${INPUT}" INPUT_STRING)

string(REGEX REPLACE
  [[CL_(API_ENTRY|API_SUFFIX|EXT)[A-Za-z0-9_]*]]
  ""
  TMP_STRING
  "${INPUT_STRING}"
)

string(REGEX REPLACE
  [=[[*]\[\]]=]
  [=[[*][*]]=]
  OUT_STRING
  "${TMP_STRING}"
)

file(WRITE "${OUTPUT}" "${OUT_STRING}")