chore: upgrade MacOS build settings for better C++20 compatibility (#1435)

* upgrade MacOS build settings for better C++20 compatibility

* add fixes I forgot

* 3rd try

* Update UserManager.cpp

* Update CMakeLists.txt

* End with newline

* Update CMakeLists.txt

* update to reflect feedback

* Update CMakeLists.txt to disable deprecation warnings on SHA512

* attempt to disable sqlite warnings

* revert last attempt (didn't work)

* disable sqlite deprecation warnings on MacOS
This commit is contained in:
jadebenn 2024-01-29 21:45:50 -06:00 committed by GitHub
parent a0d51e21ca
commit d78b50874c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 24 additions and 12 deletions

View File

@ -13,7 +13,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
os: [ windows-2022, ubuntu-22.04, macos-11 ]
os: [ windows-2022, ubuntu-22.04, macos-13 ]
steps:
- uses: actions/checkout@v3
@ -25,9 +25,11 @@ jobs:
with:
vs-version: '[17,18)'
msbuild-architecture: x64
- name: Install libssl (Mac Only)
if: ${{ matrix.os == 'macos-11' }}
run: brew install openssl@3
- name: Install libssl and switch to XCode 15.2 (Mac Only)
if: ${{ matrix.os == 'macos-13' }}
run: |
brew install openssl@3
sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
- name: cmake
uses: lukka/run-cmake@v10
with:

View File

@ -3,6 +3,7 @@ project(Darkflame)
include(CTest)
set(CMAKE_CXX_STANDARD 20)
set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# Read variables from file

View File

@ -20,7 +20,7 @@
"inherits": "default"
},
{
"name": "ci-macos-11",
"name": "ci-macos-13",
"displayName": "CI configure step for MacOS",
"description": "Same as default, Used in GitHub actions workflow",
"inherits": "default"
@ -74,8 +74,8 @@
"jobs": 2
},
{
"name": "ci-macos-11",
"configurePreset": "ci-macos-11",
"name": "ci-macos-13",
"configurePreset": "ci-macos-13",
"displayName": "MacOS CI Build",
"description": "This preset is used by the CI build on MacOS",
"jobs": 2
@ -95,8 +95,8 @@
}
},
{
"name": "ci-macos-11",
"configurePreset": "ci-macos-11",
"name": "ci-macos-13",
"configurePreset": "ci-macos-13",
"displayName": "CI Tests on MacOS",
"description": "Runs all tests on a Mac configuration",
"execution": {

View File

@ -68,3 +68,8 @@ else ()
endif ()
target_link_libraries(dCommon ZLIB::ZLIB)
# Disable deprecation warnings on MD5.cpp and SHA512.cpp for Apple Clang
if (APPLE)
set_source_files_properties("MD5.cpp" "SHA512.cpp" PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
endif()

View File

@ -451,7 +451,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
"User %i tried to rename a character that it does not own!",
u->GetAccountID());
std::find_if(u->GetCharacters().begin(), u->GetCharacters().end(), [&](Character* c) {
auto unusedItr = std::find_if(u->GetCharacters().begin(), u->GetCharacters().end(), [&](Character* c) {
if (c->GetID() == charID) {
character = c;
return true;

View File

@ -22,3 +22,7 @@ AddStripMessage::AddStripMessage(AMFArrayValue* arguments) : BehaviorMessageBase
}
LOG_DEBUG("number of actions %i", actionsToAdd.size());
}
std::vector<Action> AddStripMessage::GetActionsToAdd() const {
return actionsToAdd;
}

View File

@ -21,7 +21,7 @@ public:
AddStripMessage(AMFArrayValue* arguments);
StripUiPosition GetPosition() const { return position; };
ActionContext GetActionContext() const { return actionContext; };
std::vector<Action> GetActionsToAdd() const { return actionsToAdd; };
std::vector<Action> GetActionsToAdd() const;
private:
StripUiPosition position;
ActionContext actionContext;

View File

@ -14,6 +14,6 @@ if(UNIX)
if(NOT APPLE)
target_compile_options(sqlite3 PRIVATE "-Wno-return-local-addr" "-Wno-maybe-uninitialized")
else()
target_compile_options(sqlite3 PRIVATE "-Wno-return-stack-address" "-Wno-uninitialized")
target_compile_options(sqlite3 PRIVATE "-Wno-return-stack-address" "-Wno-uninitialized" "-Wno-deprecated-declarations")
endif()
endif()