Different IPFS binary on macOS

master
Melroy van den Berg 2022-02-09 22:30:18 +01:00
parent e22ef56274
commit 2f7a17570a
No known key found for this signature in database
GPG Key ID: 71D11FF23454B9D7
3 changed files with 20 additions and 2 deletions

12
scripts/build-macos-prod.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# By: Melroy van den Berg
# Description: Build macOS 64-bit production release using Drag & Drop installer
rm -rf build_prod_macos
mkdir build_prod_macos
cd build_prod_macos
cmake -G Ninja -DDOXYGEN:BOOL=FALSE -DCMAKE_BUILD_TYPE=Release ..
ninja &&
echo "INFO: Start Drag & Drop packaging for MacOS...";
cpack -C Release -G DragNDrop

View File

@ -94,9 +94,13 @@ if(NOT UNITTEST)
target_compile_definitions(${PROJECT_TARGET} PRIVATE _WIN32)
endif()
# Define __linux__ for Unix platforms
if (UNIX)
if(UNIX)
target_compile_definitions(${PROJECT_TARGET} PRIVATE __linux__)
endif()
# Define __APPLE__ for macOS platforms
if(APPLE)
target_compile_definitions(${PROJECT_TARGET} PRIVATE __APPLE__)
endif()
# Add fallback for std filesystem in older GCC versions
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")

View File

@ -125,8 +125,10 @@ std::string IPFSDaemon::locateIPFSBinary()
{
std::string ipfsBinaryName = "ipfs";
std::string currentExecutablePath;
#ifdef _WIN32
#if defined(_WIN32)
ipfsBinaryName += ".exe";
#elif defined(__APPLE__)
ipfsBinaryName += "-darwin";
#endif
// Use the current executable directory (bin folder), to locate the go-ipfs binary (for both Linux and Windows)
char* path = NULL;