From 9d67fed63c6d493eeea99d2fd5bd078c7926da98 Mon Sep 17 00:00:00 2001 From: Kirill A. Korinsky Date: Wed, 22 Sep 2021 20:22:50 +0200 Subject: Fixed build on macOS via posix-macos-addons This commit introduced support of macOS by using [posix-macos-addons](https://github.com/stanislaw/posix-macos-addons). Closes: https://github.com/J08nY/ecgen/issues/7 --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 929ef0b..04d8f36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,16 @@ include_directories(lib) add_executable(ecgen ${ECGEN_SRC}) -target_link_libraries(ecgen pthread rt pari parson sha1) +set(PLATFORM_SPECIFIC_LIBS) +if (APPLE) + find_library(LIB_ARGP argp) + find_library(LIB_POSIX_MACOS_TIMER posix-macos-timer) + + set(PLATFORM_SPECIFIC_LIBS ${LIB_ARGP} ${LIB_POSIX_MACOS_TIMER}) +else () + set(PLATFORM_SPECIFIC_LIBS rt) +endif() + +target_link_libraries(ecgen pthread pari parson sha1 ${PLATFORM_SPECIFIC_LIBS}) -- cgit v1.2.3-70-g09d2