From 5b68940efc6f9cdc7794d043b3420e2556cb6a2b Mon Sep 17 00:00:00 2001 From: Evan Burkey Date: Fri, 9 Sep 2022 11:15:05 -0700 Subject: [PATCH] update README and CmakeLists for macOS --- CMakeLists.txt | 4 +++- README.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f707083..15e544c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,9 +31,11 @@ elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux")) find_package(OpenSSL REQUIRED) target_link_libraries(advent PRIVATE bsd flint ${OPENSSL_LIBRARIES}) target_include_directories(advent PRIVATE include lib/libflint/include lib/uthash/src ${OpenSSL_INCLUDE_DIR}) -else() # Basically MacOS/Darwin +elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")) set(OpenSSL_INCLUDE_DIR /opt/homebrew/opt/openssl@3/include) find_package(OpenSSL REQUIRED) target_link_libraries(advent PRIVATE flint ${OPENSSL_LIBRARIES}) target_include_directories(advent PRIVATE include lib/libflint/include lib/uthash/src ${OpenSSL_INCLUDE_DIR}) +else() + message( FATAL_ERROR "OS ${CMAKE_SYSTEM_NAME} is not supported" ) endif() diff --git a/README.md b/README.md index 1fdd6a9..a4e7e60 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # aoc -Advent Of Code solutions using C99. +Advent Of Code solutions using C99. Builds and runs on macOS, Linux, and OpenBSD. ## Building @@ -8,7 +8,7 @@ Be sure to clone the project with its submodules: git clone --recurse-submodules https://git.fputs.com/fputs/advent -This project relies on several BSD extensions to the stdlib. BSDs should be able to build the project out of the box. Linux users will need `libbsd` installed. The package is called `libbsd-dev` on Debian-based systems. +This project relies on several BSD extensions to the stdlib. OpenBSD and macOS users should be able to build the project out of the box. Linux users will need `libbsd` installed. The package is called `libbsd-dev` on Debian-based systems. Build the project using Cmake: