Skip to content

Commit

Permalink
bootstrap: implement cmake_extract_standard_flags() without loop
Browse files Browse the repository at this point in the history
Pass all files to sed at once, and don't even change the directory for this.
  • Loading branch information
DerDakon committed Jun 7, 2017
1 parent 567bac8 commit 9c0d1e7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bootstrap
Expand Up @@ -9,11 +9,8 @@ die() {
# Compile flag extraction function.
cmake_extract_standard_flags()
{
cd "${cmake_source_dir}/Modules/Compiler/"
for file in ${1:-*}-${2}.cmake; do
sed -n "s/ *set *( *CMAKE_${2}${3}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
"${file}" | tr ';' ' '
done
sed -n "s/ *set *( *CMAKE_${2}${3}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
"${file}" "${cmake_source_dir}/Modules/Compiler/"${1:-*}-${2}.cmake 2>/dev/null | tr ';' ' '
}

# Version number extraction function.
Expand Down

0 comments on commit 9c0d1e7

Please sign in to comment.