diff --git a/CMakeLists.txt b/CMakeLists.txt index b6ca64b..b443528 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,14 @@ set(SOURCES src/string.c src/vector.c src/utility.c - src/macos.c ) -add_library(flint ${SOURCES}) +if ((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")) + add_library(flint ${SOURCES} src/macos.c) +else() + add_library(flint ${SOURCES}) +endif() + if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux")) target_link_libraries(flint bsd) endif() diff --git a/tests/tests.c b/tests/tests.c index b76cffa..60d8c7e 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -304,6 +304,7 @@ void test_string() { printf("Passes all string tests\n"); } +#if defined(__APPLE__) || defined(__MACH__) void test_macos() { printf("\n--- macOS TEST ---\n"); @@ -316,6 +317,7 @@ void test_macos() { } free(pd); } +#endif int main() { test_ll();