fix for Linux

This commit is contained in:
Evan Burkey 2023-12-28 12:31:14 -08:00
parent 637aa01364
commit 474232271c
2 changed files with 8 additions and 2 deletions

View File

@ -15,10 +15,14 @@ set(SOURCES
src/string.c src/string.c
src/vector.c src/vector.c
src/utility.c src/utility.c
src/macos.c
) )
if ((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin"))
add_library(flint ${SOURCES} src/macos.c)
else()
add_library(flint ${SOURCES}) add_library(flint ${SOURCES})
endif()
if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux")) if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
target_link_libraries(flint bsd) target_link_libraries(flint bsd)
endif() endif()

View File

@ -304,6 +304,7 @@ void test_string() {
printf("Passes all string tests\n"); printf("Passes all string tests\n");
} }
#if defined(__APPLE__) || defined(__MACH__)
void test_macos() { void test_macos() {
printf("\n--- macOS TEST ---\n"); printf("\n--- macOS TEST ---\n");
@ -316,6 +317,7 @@ void test_macos() {
} }
free(pd); free(pd);
} }
#endif
int main() { int main() {
test_ll(); test_ll();