From 2d95684e4dd665010c67989224425fd550ad9a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Martign=C3=A8ne?= Date: Wed, 8 Dec 2021 13:57:33 +0100 Subject: [PATCH] Fix missing ifdefs in amalgamated libhs.h --- cmake/AmalgamateSourceFiles.cmake | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/cmake/AmalgamateSourceFiles.cmake b/cmake/AmalgamateSourceFiles.cmake index bf09d495..089f2535 100644 --- a/cmake/AmalgamateSourceFiles.cmake +++ b/cmake/AmalgamateSourceFiles.cmake @@ -45,18 +45,9 @@ foreach(line IN LISTS lines) file(READ "${include_file_full}" include_content) string(REGEX REPLACE "\n$" "" include_content "${include_content}") - string(FIND "${include_content}" "#ifndef " offset_ifndef) - string(FIND "${include_content}" "#include " offset_include) - if(offset_ifndef EQUAL -1 AND offset_include EQUAL -1) + string(FIND "${include_content}" "#" offset) + if(offset EQUAL -1) set(offset 0) - elseif(offset_include EQUAL -1) - set(offset ${offset_ifndef}) - elseif(offset_ifndef EQUAL -1) - set(offset ${offset_include}) - elseif(offset_include GREATER offset_ifndef) - set(offset ${offset_ifndef}) - else() - set(offset ${offset_include}) endif() string(SUBSTRING "${include_content}" ${offset} -1 include_content) string(REGEX REPLACE "(#include \"[a-zA-Z0-9\\.-_]+\")" "// \\1" include_content "${include_content}")