Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1 build fix #32

Merged
merged 13 commits into from
Jan 8, 2024
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

# For OS X
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
execute_process(
COMMAND /opt/homebrew/bin/brew --prefix openssl@1.1
RESULT_VARIABLE BREW_OPENSSL
OUTPUT_VARIABLE BREW_OPENSSL_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (BREW_OPENSSL EQUAL 0 AND EXISTS "${BREW_OPENSSL_PREFIX}")
include_directories("${BREW_OPENSSL_PREFIX}/include")
link_libraries("-L${BREW_OPENSSL_PREFIX}/lib")
endif()
damianhxy marked this conversation as resolved.
Show resolved Hide resolved
endif()

# configure a header file to pass the version number to the source code
configure_file(
"${PROJECT_SOURCE_DIR}/src/build_config.h.in"
Expand Down
2 changes: 1 addition & 1 deletion lib/autolab/json_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define LIBAUTOLAB_JSON_HELPERS_H_

#include <cmath>

#include <string>
#include <rapidjson/document.h>

void require_is_array(rapidjson::Value &obj);
Expand Down
11 changes: 11 additions & 0 deletions src/file/file_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@

#include "logger.h"

#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(exp) \
({ \
decltype(exp) _rc; \
do { \
_rc = (exp); \
} while (_rc == -1 && errno == EINTR); \
_rc; \
})
#endif

const char *home_directory = NULL;
char curr_directory[MAX_DIR_LENGTH];

Expand Down