CMake: Determine host page size at build time

Needed for running on Asahi Linux.
This commit is contained in:
Stenzek
2024-02-24 21:40:56 +10:00
parent ab83247de3
commit 4a70164dac
5 changed files with 70 additions and 16 deletions

View File

@@ -105,7 +105,12 @@ if(ANDROID)
target_link_libraries(common PRIVATE log)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(LINUX)
# We need -lrt for shm_unlink
target_link_libraries(common PRIVATE rt)
endif()
# If the host size was detected, we need to set it as a macro.
if(HOST_PAGE_SIZE)
target_compile_definitions(common PUBLIC "-DOVERRIDE_HOST_PAGE_SIZE=${HOST_PAGE_SIZE}")
endif()