Skip to content

Commit 1188db9

Browse files
committed
CMake: simplify musl version detection
1 parent 685676b commit 1188db9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,9 @@ endif()
665665

666666
if(LINUX AND EXISTS "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR}.so.1")
667667
execute_process(COMMAND "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR}.so.1"
668-
ERROR_VARIABLE LD_MUSL_VERSION)
669-
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LD_MUSL_VERSION "${LD_MUSL_VERSION}")
670-
if(NOT LD_MUSL_VERSION STREQUAL "")
671-
target_compile_definitions(libfastfetch PUBLIC FF_MUSL_VERSION="${LD_MUSL_VERSION}")
668+
ERROR_VARIABLE LD_MUSL_RESULT)
669+
if("${LD_MUSL_RESULT}" MATCHES "Version ([0-9]+\\.[0-9]+\\.[0-9]+)")
670+
target_compile_definitions(libfastfetch PUBLIC FF_MUSL_VERSION="${CMAKE_MATCH_1}")
672671
endif()
673672
endif()
674673

0 commit comments

Comments
 (0)