Skip to content
Merged
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
36 changes: 28 additions & 8 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,40 @@ jobs:
runner: macos-14
- name: "macOS 13"
runner: macos-13
- name: "Windows"
runner: windows-latest
runs-on: ${{ matrix.runner }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

# Configure in-source build and tests
- name: Configure CMake
run: cmake -S . -B . -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
# Configure in-source build and tests
- name: Configure CMake
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
cmake -S . -B build -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
else
cmake -S . -B . -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
fi

- name: Build project
run: cmake --build .
- name: Build project
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
cmake --build build
else
cmake --build .
fi

- name: Test project
run: make test
- name: Test project
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
cd build && ctest --output-on-failure
else
make test
fi

integration-test:
needs: build
Expand Down
6 changes: 5 additions & 1 deletion cmake/CXXSniffer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ else (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (UNKNOWN true)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")

set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wsign-compare -Wreturn-type ${CMAKE_CXX_FLAGS}")
if (NOT MSVC)
set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wsign-compare -Wreturn-type ${CMAKE_CXX_FLAGS}")
else()
set (CMAKE_CXX_FLAGS "/W4 ${CMAKE_CXX_FLAGS}")
endif()
11 changes: 11 additions & 0 deletions src/Datetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3124,6 +3124,16 @@ time_t Datetime::timegm(struct tm* tm) {
time_t ret;
char* tz;
tz = getenv("TZ");
#ifdef _WIN32
_putenv_s("TZ", "UTC");
_tzset();
ret = mktime(tm);
if (tz)
_putenv_s("TZ", tz);
else
_putenv_s("TZ", "");
_tzset();
#else
setenv("TZ", "UTC", 1);
tzset();
ret = mktime(tm);
Expand All @@ -3132,6 +3142,7 @@ time_t Datetime::timegm(struct tm* tm) {
else
unsetenv("TZ");
tzset();
#endif
return ret;
}
#endif
Expand Down
Loading