Skip to content

Commit

Permalink
Fix generating upperilm.sort
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf authored and xoviat committed Dec 23, 2017
1 parent 1aab8cd commit 33ef678
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tools/flang2/utils/upper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,18 @@ add_executable(upperl
upperl.c
)


# Generate upper tables
file(STRINGS "${UTILS_UPPER_DIR}/upperilm.in" UPPERILM_H_CONTENTS)
list(SORT UPPERILM_H_CONTENTS)
set(UPPERILM_H_CONTENTS_SORTED "")
foreach(Line ${UPPERILM_H_CONTENTS})
# Don't modify the line if it contains #local at the end.
if(NOT "${Line}" MATCHES "^ *\#$")
if ("${UPPERILM_H_CONTENTS_SORTED}" STREQUAL "")
set(UPPERILM_H_CONTENTS_SORTED "${Line}")
else()
set(UPPERILM_H_CONTENTS_SORTED "${UPPERILM_H_CONTENTS_SORTED}\n${Line}")
endif()
string(SUBSTRING "${Line}" 0 1 FIRST_CHAR)
if(NOT "${FIRST_CHAR}" STREQUAL "#")
set(UPPERILM_H_CONTENTS_SORTED "${UPPERILM_H_CONTENTS_SORTED}${Line}\n")
endif()
endforeach()

file(WRITE ${UTILS_UPPER_BIN_DIR}/upperilm.sort "${UPPERILM_H_CONTENTS_SORTED}")

add_custom_command(
Expand Down

0 comments on commit 33ef678

Please sign in to comment.