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}")