Skip to content

Commit

Permalink
Add notes about musl detection and an option to force musl build
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyao233 committed Jan 14, 2025
1 parent a678ed4 commit a10c830
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ if (APPLE)
set(OLDEST_OSX_SUPPPORTED "11.7")
elseif (UNIX)
set(LINUX 1)
# Identify whether building with (and targeting) musl libc

# Identify whether building with (and targeting) musl libc with ldd. This
# assumes a native build. For cross compiling, a musl build could be forced
# by DR_TARGET_MUSL.
find_program(LDD ldd DOC "util for examing shared object dependency")
if (NOT LDD)
message(STATUS "Unable to find ldd: assume glibc")
Expand All @@ -200,6 +203,11 @@ elseif (UNIX)
set(MUSL 1)
endif ()
endif ()

option(DR_TARGET_MUSL "Target musl libc" OFF)
if (DR_TARGET_MUSL)
set(MUSL 1)
endif ()
endif (APPLE)
if (WIN32)
set(WINDOWS 1)
Expand Down

0 comments on commit a10c830

Please sign in to comment.