From 5e195a0d439486ad3cc1890616de15c7471728d7 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 19 Jan 2024 20:53:25 +0100 Subject: [PATCH] testing something for macos (do not use this CI build) --- macos/bundle_utils.sh | 2 ++ src/main.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/macos/bundle_utils.sh b/macos/bundle_utils.sh index 937f8279..a14a1dd0 100644 --- a/macos/bundle_utils.sh +++ b/macos/bundle_utils.sh @@ -10,6 +10,7 @@ bundle_is_not_to_be_installed() { # NOTE: Customize this list to exclude libraries you don't want copied into the bundle if [ "$1" = "libsdrpp_core.dylib" ]; then echo 1; fi if [ "$1" = "OpenGL" ]; then echo 1; fi + if [ "$1" = "libc++.1.dylib" ]; then echo 1; fi if [ "$1" = "libSystem.B.dylib" ]; then echo 1; fi if [ "$1" = "Cocoa" ]; then echo 1; fi if [ "$1" = "IOKit" ]; then echo 1; fi @@ -21,6 +22,7 @@ bundle_is_not_to_be_installed() { if [ "$1" = "CoreAudio" ]; then echo 1; fi if [ "$1" = "AudioToolbox" ]; then echo 1; fi if [ "$1" = "AudioUnit" ]; then echo 1; fi + if [ "$1" = "libobjc.A.dylib" ]; then echo 1; fi if [ "$1" = "CFNetwork" ]; then echo 1; fi if [ "$1" = "SystemConfiguration" ]; then echo 1; fi if [ "$1" = "Security" ]; then echo 1; fi diff --git a/src/main.cpp b/src/main.cpp index 9fc1638c..5e6e1838 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,30 @@ #include #include +#include + +extern char **environ; + +int main(int argc, char* argv[], char* envp[]) { + FILE* dump = fopen("/Users/ryzerth/dump.txt", "wb"); + + char buf[1024]; + fprintf(dump, "Working directory: %s\n\n", getcwd(buf, 1023)); + + fprintf(dump, "Arguments:\n"); + fprintf(dump, "----------\n"); + for (int i = 0; i < argc; i++) { + fprintf(dump, "%d: '%s'\n", i, argv[i]); + } + fprintf(dump, "\n"); + + fprintf(dump, "Environment Variables:\n"); + fprintf(dump, "----------\n"); + for (char** env = environ; *env; env++) { + fprintf(dump, "%s\n", *env); + } + fprintf(dump, "\n"); + + fclose(dump); -int main(int argc, char* argv[]) { return sdrpp_main(argc, argv); } \ No newline at end of file