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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build-windows:
uses: ./.github/workflows/windows.yml
with:
cmake-version: '3.31.0'
cmake-version: '4.2.7'
platforms: "['x64', 'Win32', 'ARM64']"
configurations: "['RelWithDebInfo', 'Debug']"
# MacOS
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
jobs:
build:
runs-on: windows-latest
env:
# CMake 4.x removed compatibility with cmake_minimum_required(VERSION < 3.5).
# The vendored RapidJSON source (downloaded at configure time) still declares an
# older minimum, so clamp the policy version for its nested/child configures.
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
strategy:
matrix:
platform: ${{ fromJson(inputs.platforms) }}
Expand All @@ -26,11 +31,11 @@ jobs:
with:
submodules: 'true'
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2.0.2
uses: jwlawson/actions-setup-cmake@v2.2.0
with:
cmake-version: ${{ inputs.cmake-version }}
- name: CMake Configure
run: cmake -G "Visual Studio 17 2022" -A ${{ matrix.platform }} -B ./Built/Int/cmake_${{ matrix.platform }} .
run: cmake -G "Visual Studio 18 2026" -A ${{ matrix.platform }} -B ./Built/Int/cmake_${{ matrix.platform }} .
- name: CMake Build
run: cmake --build . --target install --config ${{ matrix.config }}
working-directory: ./Built/Int/cmake_${{ matrix.platform }}
Expand Down
2 changes: 1 addition & 1 deletion External/RapidJSON/CMakeRapidJSONDownload.txt.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.2)
cmake_minimum_required(VERSION 3.5)

project(RapidJSON-download NONE)

Expand Down
2 changes: 1 addition & 1 deletion External/googletest/CMakeGoogleTestDownload.txt.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.2)
cmake_minimum_required(VERSION 3.5)

project(googletest-download NONE)

Expand Down
7 changes: 7 additions & 0 deletions GLTFSDK.Samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
cmake_minimum_required(VERSION 3.5)

# Visual Studio 2026 (MSVC 14.5x) removed the <experimental/filesystem> header that
# these samples previously used. Build the samples as C++17 so they use the standard
# <filesystem> header instead (see each sample's Source/main.cpp). The GLTFSDK library
# itself continues to target C++14.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory(Deserialize)
add_subdirectory(Serialize)
20 changes: 9 additions & 11 deletions GLTFSDK.Samples/Deserialize/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#include <GLTFSDK/GLBResourceReader.h>
#include <GLTFSDK/Deserialize.h>

// Replace this with <filesystem> (and use std::filesystem rather than
// std::experimental::filesystem) if your toolchain fully supports C++17
#include <experimental/filesystem>
#include <filesystem>

#include <fstream>
#include <sstream>
Expand All @@ -28,7 +26,7 @@ namespace
class StreamReader : public IStreamReader
{
public:
StreamReader(std::experimental::filesystem::path pathBase) : m_pathBase(std::move(pathBase))
StreamReader(std::filesystem::path pathBase) : m_pathBase(std::move(pathBase))
{
assert(m_pathBase.has_root_path());
}
Expand All @@ -44,7 +42,7 @@ namespace
// if appropriate.
// 3. Always open the file stream in binary mode. The glTF SDK will handle any text
// encoding issues for us.
auto streamPath = m_pathBase / std::experimental::filesystem::u8path(filename);
auto streamPath = m_pathBase / std::filesystem::u8path(filename);
auto stream = std::make_shared<std::ifstream>(streamPath, std::ios_base::binary);

// Check if the stream has no errors and is ready for I/O operations
Expand All @@ -57,7 +55,7 @@ namespace
}

private:
std::experimental::filesystem::path m_pathBase;
std::filesystem::path m_pathBase;
};

// Uses the Document class to print some basic information about various top-level glTF entities
Expand Down Expand Up @@ -185,13 +183,13 @@ namespace
}
}

void PrintInfo(const std::experimental::filesystem::path& path)
void PrintInfo(const std::filesystem::path& path)
{
// Pass the absolute path, without the filename, to the stream reader
auto streamReader = std::make_unique<StreamReader>(path.parent_path());

std::experimental::filesystem::path pathFile = path.filename();
std::experimental::filesystem::path pathFileExt = pathFile.extension();
std::filesystem::path pathFile = path.filename();
std::filesystem::path pathFileExt = pathFile.extension();

std::string manifest;

Expand Down Expand Up @@ -271,11 +269,11 @@ int main(int argc, char* argv[])
throw std::runtime_error("Unexpected number of command line arguments");
}

std::experimental::filesystem::path path = argv[1U];
std::filesystem::path path = argv[1U];

if (path.is_relative())
{
auto pathCurrent = std::experimental::filesystem::current_path();
auto pathCurrent = std::filesystem::current_path();

// Convert the relative path into an absolute path by appending the command line argument to the current path
pathCurrent /= path;
Expand Down
20 changes: 9 additions & 11 deletions GLTFSDK.Samples/Serialize/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#include <GLTFSDK/IStreamWriter.h>
#include <GLTFSDK/Serialize.h>

// Replace this with <filesystem> (and use std::filesystem rather than
// std::experimental::filesystem) if your toolchain fully supports C++17
#include <experimental/filesystem>
#include <filesystem>

#include <fstream>
#include <sstream>
Expand All @@ -30,7 +28,7 @@ namespace
class StreamWriter : public IStreamWriter
{
public:
StreamWriter(std::experimental::filesystem::path pathBase) : m_pathBase(std::move(pathBase))
StreamWriter(std::filesystem::path pathBase) : m_pathBase(std::move(pathBase))
{
assert(m_pathBase.has_root_path());
}
Expand All @@ -46,7 +44,7 @@ namespace
// if appropriate.
// 3. Always open the file stream in binary mode. The glTF SDK will handle any text
// encoding issues for us.
auto streamPath = m_pathBase / std::experimental::filesystem::u8path(filename);
auto streamPath = m_pathBase / std::filesystem::u8path(filename);
auto stream = std::make_shared<std::ofstream>(streamPath, std::ios_base::binary);

// Check if the stream has no errors and is ready for I/O operations
Expand All @@ -59,7 +57,7 @@ namespace
}

private:
std::experimental::filesystem::path m_pathBase;
std::filesystem::path m_pathBase;
};

void CreateTriangleResources(Document& document, BufferBuilder& bufferBuilder, std::string& accessorIdIndices, std::string& accessorIdPositions)
Expand Down Expand Up @@ -171,13 +169,13 @@ namespace
document.SetDefaultScene(std::move(scene), AppendIdPolicy::GenerateOnEmpty);
}

void SerializeTriangle(const std::experimental::filesystem::path& path)
void SerializeTriangle(const std::filesystem::path& path)
{
// Pass the absolute path, without the filename, to the stream writer
auto streamWriter = std::make_unique<StreamWriter>(path.parent_path());

std::experimental::filesystem::path pathFile = path.filename();
std::experimental::filesystem::path pathFileExt = pathFile.extension();
std::filesystem::path pathFile = path.filename();
std::filesystem::path pathFileExt = pathFile.extension();

auto MakePathExt = [](const std::string& ext)
{
Expand Down Expand Up @@ -261,11 +259,11 @@ int main(int argc, char* argv[])
throw std::runtime_error("Unexpected number of command line arguments");
}

std::experimental::filesystem::path path = argv[1U];
std::filesystem::path path = argv[1U];

if (path.is_relative())
{
auto pathCurrent = std::experimental::filesystem::current_path();
auto pathCurrent = std::filesystem::current_path();

// Convert the relative path into an absolute path by appending the command line argument to the current path
pathCurrent /= path;
Expand Down
Loading