Skip to content

Commit

Permalink
Fix build pipeline issues (#41)
Browse files Browse the repository at this point in the history
* update to latest version of checkout action

* remove explicit selection of Windows SDK

the selected Windows SDK is outdated, so maybe this is the reason why
the build fails for std::filesystem

* generate build system

* make conversion of std::filesystem:path to std::string explicit (fix Windows build error)

* cleanup build.yml
  • Loading branch information
herzbube authored Jan 3, 2024
1 parent 87d7980 commit ae1791b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
# - We use the *-latest runners because we strive to build with relatively
# new versions of each environment that have modern compilers (we need at
# least C++17, see CMakeLists.txt) and tools.
# - As of writing this all of the *-latest runners use CMake 3.19.1.
# - The library should not only be cross-platform, it should also not rely
# on any particular compiler. On macOS the clang compiler is used
# (AppleClang), on Ubuntu the default is GNU GCC, and on Windows it's
Expand All @@ -26,7 +25,10 @@ jobs:

steps:
- name: Checking out the sources
uses: actions/checkout@v2
# @v4 refers to the Git tag "v4" in https://github.com/actions/checkout.
# The repo maintainers update the "v4" tag to always point to the latest
# v4 release of the checkout action.
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -40,19 +42,11 @@ jobs:
cmake -DCMAKE_BUILD_TYPE=Release ..
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'

- name: Generat build system (Windows)
- name: Generate build system (Windows)
run: |
mkdir build
cd build
# Setting CMAKE_SYSTEM_VERSION defines the Windows SDK that CMake should
# use for the build. We have to do this in order to override the
# Windows SDK that CMake would select on its own. The default Windows SDK
# on the windows-latest runner is currently 10.0.17763.0, and for unknown
# reasons that SDK version breaks the build. The symptoms are many C5105
# warnings, and eventually also some compiler errors. Windows SDK
# 10.0.18362.0 is a version that is known to work and that is also known
# to be installed on the windows-latest runner.
cmake -DCMAKE_SYSTEM_VERSION="10.0.18362.0" ..
cmake ..
if: matrix.os == 'windows-latest'

- name: Build the project
Expand Down
2 changes: 1 addition & 1 deletion src/SgfcUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace LibSgfcPlusPlus
std::string SgfcUtility::GetTempFolderPath()
{
std::filesystem::path tempFolderPath = std::filesystem::temp_directory_path();
return tempFolderPath;
return tempFolderPath.u8string();
}

std::string SgfcUtility::GetUniqueTempFileName()
Expand Down
10 changes: 6 additions & 4 deletions src/SgfcUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ namespace LibSgfcPlusPlus
/// SgfcPrivateConstants::ArgumentTypeToCmdlineOptionMap.
static std::string MapArgumentTypeToCmdlineOption(SgfcArgumentType argumentType);

/// @brief Returns the full path to a folder that is suitable for temporary
/// files. The path is guaranteed to exist and to be a directory.
/// @brief Returns the full path of a folder that is suitable for temporary
/// files. The path is guaranteed to exist and to be a directory. The
/// returned path string is UTF-8 encoded.
///
/// The implementation makes use of std::filesystem::temp_directory_path(),
/// which is defined in C++17 but may not be available on older platform
Expand All @@ -182,9 +183,10 @@ namespace LibSgfcPlusPlus
/// file
static std::string GetUniqueTempFileName();

/// @brief Returns the unique absolute path name of a file that is extremely
/// @brief Returns the unique absolute path of a file that is extremely
/// unlikely to already exist in the temporary folder returned by
/// GetTempPath(). This method never returns the same value twice.
/// GetTempPath(). The returned path string is UTF-8 encoded. This method
/// never returns the same value twice.
///
/// This is a convenience function that invokes JoinPathComponents() using
/// the return values of GetTempFolderPath() and GetUniqueTempFileName().
Expand Down

0 comments on commit ae1791b

Please sign in to comment.