CI bugfix and refactoring

This commit is contained in:
Alexandre 2021-11-17 15:37:21 -06:00
parent 170a48f83f
commit dde95019ea
5 changed files with 9 additions and 15 deletions

View File

@ -95,15 +95,9 @@ jobs:
- name: Install SDRplay API - name: Install SDRplay API
run: wget https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-3.07.3.pkg && sudo installer -pkg SDRplay_RSP_API-MacOSX-3.07.3.pkg -target / run: wget https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-3.07.3.pkg && sudo installer -pkg SDRplay_RSP_API-MacOSX-3.07.3.pkg -target /
- name: Install libiio
run: mkdir libiio && cd libiio && wget https://github.com/analogdevicesinc/libiio/releases/download/v0.23/macOS-10.15.pkg && sudo installer -pkg macOS-10.15.pkg -target /
- name: Install libad9361
run: wget https://github.com/analogdevicesinc/libad9361-iio/releases/download/v0.2/libad9361-0.2.pkg && sudo installer -pkg libad9361-0.2.pkg -target /
- name: Prepare CMake - name: Prepare CMake
working-directory: ${{runner.workspace}}/build working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DUSE_DOTAPP_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=OFF -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release
- name: Build - name: Build
working-directory: ${{runner.workspace}}/build working-directory: ${{runner.workspace}}/build
@ -111,7 +105,7 @@ jobs:
- name: Create Archive - name: Create Archive
working-directory: ${{runner.workspace}} working-directory: ${{runner.workspace}}
run: cd $GITHUB_WORKSPACE && sh make_macos_dotapp.sh ${{runner.workspace}}/build ./SDR++.app && zip -r ${{runner.workspace}}/sdrpp_macos_intel.zip SDR++.app run: cd $GITHUB_WORKSPACE && sh make_macos_bundle.sh ${{runner.workspace}}/build ./SDR++.app && zip -r ${{runner.workspace}}/sdrpp_macos_intel.zip SDR++.app
- name: Save Archive - name: Save Archive
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2

View File

@ -49,7 +49,7 @@ option(OPT_BUILD_SCHEDULER "Build the scheduler" OFF)
# Other options # Other options
option(USE_INTERNAL_LIBCORRECT "Use an external version of libcorrect" ON) option(USE_INTERNAL_LIBCORRECT "Use an external version of libcorrect" ON)
option(USE_DOTAPP_DEFAULTS "Set the default resource and module directories to the right ones for a MacOS .app" OFF) option(USE_BUNDLE_DEFAULTS "Set the default resource and module directories to the right ones for a MacOS .app" OFF)
# Core of SDR++ # Core of SDR++
add_subdirectory("core") add_subdirectory("core")

View File

@ -5,9 +5,9 @@ if (USE_INTERNAL_LIBCORRECT)
add_subdirectory("libcorrect/") add_subdirectory("libcorrect/")
endif (USE_INTERNAL_LIBCORRECT) endif (USE_INTERNAL_LIBCORRECT)
if (USE_DOTAPP_DEFAULTS) if (USE_BUNDLE_DEFAULTS)
add_definitions(-DMACOS_DOTAPP) add_definitions(-DIS_MACOS_BUNDLE)
endif (USE_DOTAPP_DEFAULTS) endif (USE_BUNDLE_DEFAULTS)
# Main code # Main code
file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c") file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c")

View File

@ -102,7 +102,7 @@ static void maximized_callback(GLFWwindow* window, int n) {
int sdrpp_main(int argc, char *argv[]) { int sdrpp_main(int argc, char *argv[]) {
spdlog::info("SDR++ v" VERSION_STR); spdlog::info("SDR++ v" VERSION_STR);
#ifdef MACOS_DOTAPP #ifdef IS_MACOS_BUNDLE
// If this is a MacOS .app, CD to the correct directory // If this is a MacOS .app, CD to the correct directory
auto execPath = std::filesystem::absolute(argv[0]); auto execPath = std::filesystem::absolute(argv[0]);
chdir(execPath.parent_path().string().c_str()); chdir(execPath.parent_path().string().c_str());
@ -248,7 +248,7 @@ int sdrpp_main(int argc, char *argv[]) {
#if defined(_WIN32) #if defined(_WIN32)
defConfig["modulesDirectory"] = "./modules"; defConfig["modulesDirectory"] = "./modules";
defConfig["resourcesDirectory"] = "./res"; defConfig["resourcesDirectory"] = "./res";
#elif defined(MACOS_DOTAPP) #elif defined(IS_MACOS_BUNDLE)
defConfig["modulesDirectory"] = "../Plugins"; defConfig["modulesDirectory"] = "../Plugins";
defConfig["resourcesDirectory"] = "../Resources"; defConfig["resourcesDirectory"] = "../Resources";
#else #else

View File

@ -9,7 +9,7 @@ namespace options {
#if defined(_WIN32) #if defined(_WIN32)
opts.root = "."; opts.root = ".";
opts.showConsole = false; opts.showConsole = false;
#elif defined(MACOS_DOTAPP) #elif defined(IS_MACOS_BUNDLE)
std::string homedir = getenv("HOME"); std::string homedir = getenv("HOME");
opts.root = homedir + "/Library/Application Support/sdrpp"; opts.root = homedir + "/Library/Application Support/sdrpp";
#else #else