Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci-test-static-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
build:
strategy:
matrix:
os: [windows-2022, ubuntu-latest] # + macos-latest] To implement those platforms
# we need to create ci-<OS> presets for CMake.
os: [windows-2022, ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.23)
set(GRM_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

project(resman
VERSION 1.6.1
VERSION 1.7.0
DESCRIPTION "golxzn resource manager"
LANGUAGES CXX
)
Expand Down
41 changes: 34 additions & 7 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"cmake/presets/common.json",
"cmake/presets/generators.json",
"cmake/presets/windows.json",
"cmake/presets/linux.json"
"cmake/presets/linux.json",
"cmake/presets/macos.json"
],
"configurePresets": [
{
Expand Down Expand Up @@ -44,23 +45,34 @@
{
"displayName": "[Ninja][Clang] Debug (x64)",
"name": "ninja_unix_clang_x64_debug",
"inherits": [ "ninja", "linux_clang_14", "debug" ]
"inherits": [ "ninja", "linux_clang_14_x64", "debug" ]
},
{
"displayName": "[Ninja][Clang] Release (x64)",
"name": "ninja_unix_clang_x64_release",
"inherits": [ "ninja", "linux_clang_14", "release" ]
"inherits": [ "ninja", "linux_clang_14_x64", "release" ]
},

{
"displayName": "[Ninja][GCC] Debug (x64)",
"name": "ninja_unix_gcc_x64_debug",
"inherits": [ "ninja", "linux_gcc_13", "debug" ]
"inherits": [ "ninja", "linux_gcc_13_x64", "debug" ]
},
{
"displayName": "[Ninja][GCC] Release (x64)",
"name": "ninja_unix_gcc_x64_release",
"inherits": [ "ninja", "linux_gcc_13", "release" ]
"inherits": [ "ninja", "linux_gcc_13_x64", "release" ]
},

{
"displayName": "[Ninja][Clang] Debug (x64)",
"name": "ninja_macos_clang_x64_debug",
"inherits": [ "ninja", "macos_clang_14_x64", "debug" ]
},
{
"displayName": "[Ninja][Clang] Release (x64)",
"name": "ninja_macos_clang_x64_release",
"inherits": [ "ninja", "macos_clang_14_x64", "release" ]
},

{
Expand All @@ -70,6 +82,10 @@
{
"name": "ci-ubuntu",
"inherits": "ninja_unix_gcc_x64_release"
},
{
"name": "ci-macos",
"inherits": "ninja_macos_clang_x64_release"
}

],
Expand All @@ -86,6 +102,13 @@
"inherits": "ci",
"condition": { "lhs": "${hostSystemName}", "type": "equals", "rhs": "Linux" }
},
{
"name": "ci-macos",
"configurePreset": "ci-macos",
"inherits": "ci",
"condition": { "lhs": "${hostSystemName}", "type": "equals", "rhs": "Darwin" }
},


{
"name": "ci",
Expand All @@ -107,8 +130,12 @@
"inherits": "ci",
"condition": { "lhs": "${hostSystemName}", "type": "equals", "rhs": "Linux" }
},


{
"name": "ci-macos",
"configurePreset": "ci-macos",
"inherits": "ci",
"condition": { "lhs": "${hostSystemName}", "type": "equals", "rhs": "Darwin" }
},

{
"name": "ci",
Expand Down
6 changes: 3 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
- [ ] Add `Android` platform support;
- [ ] Implement tests for `MacOS` platform;

## Release v1.8.0:
## Release v1.8.0 (in progress):

- [ ] Implement `lock`/`unlick` and `is_locked`/`is_unlocked` methods;
- [ ] Implement `format` support for `load`/`save` methods;

## Release v1.7.0 (current):

- [ ] Add `MacOS` platform support;
- [ ] Implement tests for `MacOS` platform;
- [x] Add `MacOS` platform support;
- [x] Implement tests for `MacOS` platform;

## Release v1.6.1:

Expand Down
10 changes: 5 additions & 5 deletions cmake/presets/linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
}
},
{
"name": "linux_clang_14",
"name": "linux_clang_14_x64",
"hidden": true,
"inherits": [ "linux_default" ],
"toolchainFile": "${sourceDir}/cmake/toolchains/linux/clang_14.cmake"
"toolchainFile": "${sourceDir}/cmake/toolchains/linux/clang_14_x64.cmake"
},
{
"name": "linux_gcc_13",
"name": "linux_gcc_13_x64",
"hidden": true,
"inherits": [ "linux_default" ],
"toolchainFile": "${sourceDir}/cmake/toolchains/linux/gcc_13.cmake"
"toolchainFile": "${sourceDir}/cmake/toolchains/linux/gcc_13_x64.cmake"
}
]
}
}
20 changes: 20 additions & 0 deletions cmake/presets/macos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 5,
"configurePresets": [
{
"name": "macos_default",
"hidden": true,
"binaryDir": "${sourceDir}/build/${presetName}",
"condition": { "lhs": "${hostSystemName}", "type": "equals", "rhs": "Darwin" },
"cacheVariables": {
"GRM_DEFINITIONS_INIT": "GRM_MACOS;GRM_UNIX"
}
},
{
"name": "macos_clang_14_x64",
"hidden": true,
"inherits": [ "macos_default" ],
"toolchainFile": "${sourceDir}/cmake/toolchains/macos/clang_14_x64.cmake"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ set(CMAKE_SYSTEM_NAME Linux CACHE STRING "System name")
set(CMAKE_SYSTEM_PROCESSOR x86_64 CACHE STRING "System processor")
set(CMAKE_HOST_SYSTEM_PROCESSOR x86_64 CACHE STRING "Host system processor")

set(CMAKE_C_COMPILER clang-15)
set(CMAKE_CXX_COMPILER clang++-15)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_C_COMPILER_VERSION 14)
set(CMAKE_CXX_COMPILER_VERSION 14)

find_program(ccache_program ccache)
if (NOT ${ccache_program} MATCHES "NOTFOUND")
Expand Down
16 changes: 16 additions & 0 deletions cmake/toolchains/macos/clang_14_x64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "System name")
set(CMAKE_SYSTEM_PROCESSOR x86_64 CACHE STRING "System processor")
set(CMAKE_HOST_SYSTEM_PROCESSOR x86_64 CACHE STRING "Host system processor")

set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_C_COMPILER_VERSION 14)
set(CMAKE_CXX_COMPILER_VERSION 14)

find_program(ccache_program ccache)
if (NOT ${ccache_program} MATCHES "NOTFOUND")
set(CMAKE_C_COMPILER_LAUNCHER ccache)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
endif()

2 changes: 1 addition & 1 deletion cmake/tools/GetSystemInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function(get_system_info SYSTEM_NAME ARCHITECTURE)
_get_arch(${ARCHITECTURE} ${SYSTEM_NAME})

elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(${SYSTEM_NAME} "macOS" PARENT_SCOPE)
set(${SYSTEM_NAME} "MacOS" PARENT_SCOPE)

execute_process(
COMMAND "sysctl" "-n" "machdep.cpu.brand_string"
Expand Down
1 change: 1 addition & 0 deletions code/resman/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ add_library(golxzn::resman ALIAS golxzn_resman)
target_include_directories(golxzn_resman PUBLIC ${GRM_CODE_DIR}/headers)
target_compile_definitions(golxzn_resman PUBLIC ${GRM_DEFINITIONS})
set_target_properties(golxzn_resman PROPERTIES
LIBCXX_ENABLE_INCOMPLETE_FEATURES ON
FOLDER "golxzn"
)
2 changes: 1 addition & 1 deletion code/resman/sources/platform/macos.inl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "platform/unix.inl"
#include "unix.inl"

namespace golxzn::details {

Expand Down
3 changes: 2 additions & 1 deletion code/resman/sources/resman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ std::wstring resman::normalize(std::wstring_view str) {
}

std::vector<std::wstring_view> parts;
parts.reserve(std::ranges::count_if(str, [](const auto &c){ return slash.find(c) != std::wstring_view::npos; }) + 1lu);
parts.reserve(std::ranges::count_if(str,
[](const auto &c){ return slash.find(c) != std::wstring_view::npos; }) + 1lu);
size_t prev_slash{};
size_t curr_slash{};
size_t next_slash{};
Expand Down
11 changes: 10 additions & 1 deletion resman.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@
},
{
"name": "[GDB] Launch tests",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"MIMode": "gdb",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin",
},
{
"name": "[LLDB] Launch tests",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin",
}
"MIMode": "lldb",
}
],
},
"settings": {
Expand Down