Skip to content

Commit

Permalink
major internal update - removed macOS dependency on gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
radj307 committed Mar 4, 2024
1 parent 9062329 commit c1bd44f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/MakeRelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: cmake --build build --config Release

- name: Create Archive
run: Compress-Archive build/ARRCON/*.exe ARRCON-$(.\ARRCON -vq)-Windows.zip
run: Compress-Archive build/ARRCON/ARRCON.exe ARRCON-$(.\ARRCON -vq)-Windows.zip
shell: pwsh

- name: Upload Artifact
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Create Archive
run: |
cd build/ARRCON
zip -T9 ARRCON-$(./ARRCON -vq)-Linux.zip *.exe
zip -T9 ARRCON-$(./ARRCON -vq)-Linux.zip ARRCON
mv *.zip ../..
- name: Upload Artifact
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- name: Create Archive
run: |
cd build/ARRCON
zip -T9 ARRCON-$(./ARRCON -vq)-MacOS.zip *.exe
zip -T9 ARRCON-$(./ARRCON -vq)-MacOS.zip ARRCON
mv *.zip ../..
- name: Upload Artifact
Expand Down
1 change: 1 addition & 0 deletions ARRCON/ARRCON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <color-sync.hpp> //< for color::sync
#include <envpath.hpp> //< for env::PATH
#include <hasPendingDataSTDIN.h> //< for hasPendingDataSTDIN
#include <str/strconv.hpp>

// STL
#include <filesystem> //< for std::filesystem
Expand Down
4 changes: 4 additions & 0 deletions ARRCON/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ file(GLOB RESOURCES
"${CMAKE_CURRENT_BINARY_DIR}/rc/*"
)

include_directories("/opt/local/include")

add_executable(ARRCON "${SRCS}" "${RESOURCES}")

set_property(TARGET ARRCON PROPERTY CXX_STANDARD 20)
Expand All @@ -59,6 +61,8 @@ target_sources(ARRCON PRIVATE "${HEADERS}")
find_package(Boost 1.84.0 COMPONENTS asio)
# Fallback to FetchContent if not found
if (NOT Boost_FOUND)
message(STATUS "Downloading Boost 1.84.0 via FetchContent")

include(FetchContent)
FetchContent_Declare(
Boost
Expand Down
6 changes: 5 additions & 1 deletion ARRCON/net/rcon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ namespace net {
*/
void set_timeout(int timeout_ms)
{
socket.set_option(boost::asio::detail::socket_option::integer<SOL_SOCKET, SO_RCVTIMEO>{ timeout_ms });
try {
socket.set_option(boost::asio::detail::socket_option::integer<SOL_SOCKET, SO_RCVTIMEO>{ timeout_ms });
} catch (std::exception const& ex) {
std::clog << MessageHeader(LogLevel::Error) << "Failed to set socket timeout due to exception: \"" << ex.what() << '\"' << std::endl;
}
}

/**
Expand Down
9 changes: 6 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"warnings": {
"deprecated": true,
"unusedCli": true,
Expand Down Expand Up @@ -78,6 +75,12 @@
"name": "macos-default",
"inherits": "base",
"hidden": true,
"cacheVariables": {
"CMAKE_C_COMPILER": "/opt/local/bin/clang-mp-17",
"CMAKE_CXX_COMPILER": "/opt/local/bin/clang++-mp-17",
// This requires the full path to ninja because visual studio doesn't find it on the PATH when cross compiling:
"CMAKE_MAKE_PROGRAM": "/usr/local/bin/ninja"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "macOS" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
Expand Down

0 comments on commit c1bd44f

Please sign in to comment.