1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

bootstrap: implement cmake_extract_standard_flags() without loop

Pass all files to sed at once, and don't even change the directory for this.
This commit is contained in:
Rolf Eike Beer
2017-06-07 19:34:10 +02:00
parent 567bac890c
commit 9c0d1e7531

View File

@@ -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.