Merge pull request #3 from funky-yellow-wombat/patch-1

Support GLIBC Version Targeting
This commit is contained in:
Duncan Ogilvie
2025-02-17 16:27:55 +01:00
committed by GitHub

View File

@@ -8,11 +8,11 @@ if(NOT DEFINED ZIG_TARGET)
get_filename_component(PARENT_LIST_DIR "${CMAKE_PARENT_LIST_FILE}" DIRECTORY) get_filename_component(PARENT_LIST_DIR "${CMAKE_PARENT_LIST_FILE}" DIRECTORY)
string(FIND "${CMAKE_CURRENT_LIST_DIR}" "${PARENT_LIST_DIR}" POS) string(FIND "${CMAKE_CURRENT_LIST_DIR}" "${PARENT_LIST_DIR}" POS)
if(POS EQUAL 0) if(POS EQUAL 0)
get_filename_component(ZIG_TARGET "${CMAKE_PARENT_LIST_FILE}" NAME_WE) get_filename_component(ZIG_TARGET "${CMAKE_PARENT_LIST_FILE}" NAME_WLE)
endif() endif()
endif() endif()
if(NOT ZIG_TARGET MATCHES "^([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_]+)$") if(NOT ZIG_TARGET MATCHES "^([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_]+)-([a-zZ-Z0-9_.]+)$")
message(FATAL_ERROR "Expected ZIG_TARGET=<arch>-<os>-<abi>") message(FATAL_ERROR "Expected ZIG_TARGET=<arch>-<os>-<abi>")
endif() endif()