Skip to content

Commit 59c6665

Browse files
committed
Version (MidnightBSD): support libc version detection
1 parent 7fab6f2 commit 59c6665

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,17 +1127,25 @@ if(APPLE AND EXISTS "/usr/bin/otool")
11271127
target_compile_definitions(libfastfetch PUBLIC FF_LIBSYSTEM_VERSION="${CMAKE_MATCH_1}")
11281128
endif()
11291129
endif()
1130-
if(FreeBSD AND EXISTS "/usr/local/bin/objdump")
1130+
if(MidnightBSD AND EXISTS "/usr/bin/objdump")
1131+
execute_process(COMMAND /bin/sh -c "/usr/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[0-9][0-9]*\\.[0-9][0-9]*' -o | sort -Vru | head -1"
1132+
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
1133+
if("${OBJDUMP_T_RESULT}" MATCHES "FBSD_([0-9]+\\.[0-9]+)")
1134+
message(STATUS "Found FBSD ${CMAKE_MATCH_1}")
1135+
target_compile_definitions(libfastfetch PUBLIC FF_FBSD_VERSION="${CMAKE_MATCH_1}")
1136+
endif()
1137+
elseif(FreeBSD AND EXISTS "/usr/local/bin/objdump")
11311138
execute_process(COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'FBSD_[0-9][0-9]*\\.[0-9][0-9]*' -o | sort -Vru | head -1"
11321139
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
11331140
if("${OBJDUMP_T_RESULT}" MATCHES "FBSD_([0-9]+\\.[0-9]+)")
1141+
message(STATUS "Found FBSD ${CMAKE_MATCH_1}")
11341142
target_compile_definitions(libfastfetch PUBLIC FF_FBSD_VERSION="${CMAKE_MATCH_1}")
11351143
endif()
1136-
endif()
1137-
if(DragonFly AND EXISTS "/usr/local/bin/objdump")
1144+
elseif(DragonFly AND EXISTS "/usr/local/bin/objdump")
11381145
execute_process(COMMAND /bin/sh -c "/usr/local/bin/objdump -T /lib/libc.so.* | grep 'DF[0-9][0-9]*\\.[0-9][0-9]*' -o | sort -Vru | head -1"
11391146
OUTPUT_VARIABLE OBJDUMP_T_RESULT)
11401147
if("${OBJDUMP_T_RESULT}" MATCHES "DF([0-9]+\\.[0-9]+)")
1148+
message(STATUS "Found DF ${CMAKE_MATCH_1}")
11411149
target_compile_definitions(libfastfetch PUBLIC FF_DF_VERSION="${CMAKE_MATCH_1}")
11421150
endif()
11431151
endif()

0 commit comments

Comments
 (0)