Add darwin C source compile flag for MacOS

master
Melroy van den Berg 2022-02-05 18:50:20 +01:00
parent bf8b534513
commit 4331631a27
No known key found for this signature in database
GPG Key ID: 71D11FF23454B9D7
1 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,11 @@ add_library(${LIBARY_NAME} STATIC whereami.c whereami.h)
# Add X/Open definition for realpath
target_compile_definitions(${LIBARY_NAME} PUBLIC _XOPEN_SOURCE=500)
# MacOS specific compile flag
if(APPLE)
target_compile_definitions(${LIBARY_NAME} PUBLIC _DARWIN_C_SOURCE)
endif()
# Use PUBLIC iso INTERFACE, so the library itself also finds it's own header file
target_include_directories(
${LIBARY_NAME}