Skip to content

Commit

Permalink
Fix missing ifdefs in amalgamated libhs.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Koromix committed Dec 8, 2021
1 parent 46b89f9 commit 2d95684
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions cmake/AmalgamateSourceFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 2d95684

Please sign in to comment.