Skip to content

Commit

Permalink
fix(bin): fix builds for darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Jan 27, 2025
1 parent a6aef39 commit 7f3cce3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 24 deletions.
1 change: 1 addition & 0 deletions bin/build-runtime-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ declare sources=(
$(find "$root"/src/runtime/filesystem/*.cc)
$(find "$root"/src/runtime/http/*.cc)
$(find "$root"/src/runtime/ini/*.cc)
$(find "$root"/src/runtime/io/*.cc)
$(find "$root"/src/runtime/ipc/*.cc)
$(find "$root"/src/runtime/javascript/*.cc)
$(find "$root"/src/runtime/json/*.cc)
Expand Down
5 changes: 4 additions & 1 deletion bin/ldflags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ if [[ "$host" = "Darwin" ]]; then
ldflags+=("-framework" "Accelerate")
ldflags+=("-framework" "UserNotifications")
ldflags+=("-framework" "OSLog")
if !(( TARGET_OS_IPHONE )) && !(( TARGET_IPHONE_SIMULATOR )); then
ldflags+=("-L$(brew --prefix llvm)/lib/c++")
ldflags+=("-L$(brew --prefix llvm)/lib")
fi
ldflags+=("-ldl")
ldflags+=("-lomp")
ldflags+=("-lggml")
ldflags+=("-lggml-cpu")
ldflags+=("-lggml-base")
Expand Down
24 changes: 1 addition & 23 deletions src/runtime/io.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,7 @@
#include "platform.hh"
#include "env.hh"

namespace ssc::cli {
void notify ();
}

namespace ssc::runtime::io {
inline void write (const String& input, bool isErrorOutput = false) {
static const auto GITHUB_ACTIONS_CI = env::get("GITHUB_ACTIONS_CI");
static const auto isGitHubActionsCI = GITHUB_ACTIONS_CI.size() > 0;
auto& stream = isErrorOutput ? std::cerr : std::cout;

stream << input;

#if SOCKET_RUNTIME_PLATFORM_WINDOWS
if (isGitHubActionsCI) {
ssc::cli::notify();
// skip writing newline if running on Windows GHA CI
return;
}

#endif
stream << std::endl;

ssc::cli::notify();
}
void write (const String& input, bool isErrorOutput = false);
}
#endif
25 changes: 25 additions & 0 deletions src/runtime/io/write.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "../../cli.hh"

#include "../io.hh"

namespace ssc::runtime::io {
void write (const String& input, bool isErrorOutput) {
static const auto GITHUB_ACTIONS_CI = env::get("GITHUB_ACTIONS_CI");
static const auto isGitHubActionsCI = GITHUB_ACTIONS_CI.size() > 0;
auto& stream = isErrorOutput ? std::cerr : std::cout;

stream << input;

#if SOCKET_RUNTIME_PLATFORM_WINDOWS
if (isGitHubActionsCI) {
ssc::cli::notify();
// skip writing newline if running on Windows GHA CI
return;
}

#endif
stream << std::endl;

ssc::cli::notify();
}
}

0 comments on commit 7f3cce3

Please sign in to comment.