Skip to content

Commit

Permalink
Support for Apple SoC
Browse files Browse the repository at this point in the history
  • Loading branch information
Addvilz committed Jun 30, 2021
1 parent d86c35d commit b5d8d24
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Mon May 24 2021 Matiss Treinis <mrtreinis@gmail.com> - 1.1.5.1
- Support for Apple SoC

* Mon May 24 2021 Matiss Treinis <mrtreinis@gmail.com> - 1.1.5
- Bugfix - within aliased to shell in local context.

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.11.4)

# IMPORTANT: updating version might require update in package dependencies at the end of this file.
set(KAFE_VERSION "1.1.5")
set(KAFE_VERSION "1.1.5.1")
set(KAFE_SOVERSION "1.1")
set(KAFE_VERSION_INT 11)
set(KAFE_VERSION_DEP_NEXT_MAJOR "2.0.0")
Expand Down
39 changes: 36 additions & 3 deletions build-dist-macos.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
#!/usr/bin/env bash
set -xe

# Build OSX from current directory.

echo "Building libkafe for macOS"

mkdir -p build/osx/
cd build/osx

export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
if [[ -z "${KAFE_CC}" ]]; then
if [ -f "/opt/homebrew/opt/llvm/bin/clang" ]; then
export CC=/opt/homebrew/opt/llvm/bin/clang
else
export CC=/usr/local/opt/llvm/bin/clang
fi
echo "Will look for C compiler at ${CC}"
else
echo "Using preset C compiler from environment - KAFE_CC - ${KAFE_CC}"
export CC=${KAFE_CC}
fi

if [[ -z "${KAFE_CXX}" ]]; then
if [ -f "/opt/homebrew/opt/llvm/bin/clang++" ]; then
export CXX=/opt/homebrew/opt/llvm/bin/clang++
else
export CXX=/usr/local/opt/llvm/bin/clang++
fi
echo "Will look for C++ compiler at ${CXX}"
else
echo "Using preset C++ compiler from environment - KAFE_CXX - ${KAFE_CXX}"
export CXX=${KAFE_CXX}
fi

if [ ! -f "${CC}" ]; then
echo "Fail: C compiler not found. Declare explicitly using KAFE_CC environment variable"
exit 1
fi

if [ ! -f "${CXX}" ]; then
echo "Fail: C++ compiler not found. Declare explicitly using KAFE_CXX environment variable"
exit 1
fi

set -xe
cmake ../..
make
4 changes: 2 additions & 2 deletions cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ extern char** environ;

void loadEnvMap(map<const string, const string> &envVals) {
for (char **current = environ; *current; ++current) {
const string envVal = string(*current);
const ulong pos = envVal.find_first_of('=');
const auto envVal = string(*current);
const auto pos = envVal.find_first_of('=');
pair<string, string> p = pair<string, string>(
envVal.substr(0, pos),
envVal.substr(pos + 1)
Expand Down
2 changes: 1 addition & 1 deletion libkafe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (NOT UNIX AND NOT APPLE)
endif ()

if(APPLE)
set(CMAKE_PREFIX_PATH "/usr/local/opt/libarchive/;/usr/local/opt/libssh/;/usr/local/opt/curl/;/usr/local/opt/libgit2/;/usr/local/opt/lua/")
set(CMAKE_PREFIX_PATH "/usr/local/opt/libarchive/;/usr/local/opt/libssh/;/usr/local/opt/curl/;/usr/local/opt/libgit2/;/usr/local/opt/lua/;/opt/homebrew/opt/libarchive/;/opt/homebrew/opt/libssh/;/opt/homebrew/opt/curl/;/opt/homebrew/opt/libgit2/;/opt/homebrew/opt/lua/")
endif()

if (CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down

0 comments on commit b5d8d24

Please sign in to comment.