Skip to content

Commit

Permalink
chore: update project to require C++20 standard
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Jan 1, 2025
1 parent 2a421c8 commit 8556841
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ jobs:
- name: Build with Conan (Linux)
if: runner.os == 'Linux'
run: |
conan create . --build=missing -s compiler.cppstd=17 -s build_type=${{ matrix.build_type }} -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.libcxx=libc++
conan create . --build=missing -s compiler.cppstd=20 -s build_type=${{ matrix.build_type }} -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.libcxx=libc++
- name: Build with Conan (Windows)
if: runner.os == 'Windows'
run: |
conan create . --build=missing -s compiler.cppstd=17 -s build_type=${{ matrix.build_type }} -c tools.cmake.cmaketoolchain:generator=Ninja
conan create . --build=missing -s compiler.cppstd=20 -s build_type=${{ matrix.build_type }} -c tools.cmake.cmaketoolchain:generator=Ninja
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
python -m pip install --upgrade pip
pip install conan
conan profile detect --force
conan install . --build=missing -s compiler.cppstd=17 -s compiler.libcxx=libc++ -s build_type=Debug -c tools.cmake.cmaketoolchain:generator=Ninja
conan install . --build=missing -s compiler.cppstd=20 -s compiler.libcxx=libc++ -s build_type=Debug -c tools.cmake.cmaketoolchain:generator=Ninja
- name: Build with CMake
run: |
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ First of all, run the following commands to install dependencies of this project

=== ":fontawesome-brands-windows: Command Prompt"
```shell
conan install . --build=missing -s compiler.cppstd=17 -s build_type=RelWithDebInfo -c tools.cmake.cmaketoolchain:generator=Ninja
conan install . --build=missing -s compiler.cppstd=20 -s build_type=RelWithDebInfo -c tools.cmake.cmaketoolchain:generator=Ninja
```

=== ":fontawesome-brands-windows: Powershell"
```shell
conan install . --build=missing -s compiler.cppstd=17 -s build_type=RelWithDebInfo -c tools.cmake.cmaketoolchain:generator=Ninja -c tools.env.virtualenv:powershell=True
conan install . --build=missing -s compiler.cppstd=20 -s build_type=RelWithDebInfo -c tools.cmake.cmaketoolchain:generator=Ninja -c tools.env.virtualenv:powershell=True
```

=== ":fontawesome-brands-linux: Linux"

```shell
conan install . --build=missing -s compiler.cppstd=17 -s compiler.libcxx=libc++ -s build_type=RelWithDebInfo -c tools.cmake.cmaketoolchain:generator=Ninja
conan install . --build=missing -s compiler.cppstd=20 -s compiler.libcxx=libc++ -s build_type=RelWithDebInfo -c tools.cmake.cmaketoolchain:generator=Ninja
```

Now, activate the build virtual environment create by conan.
Expand Down
6 changes: 3 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def set_version(self):

@property
def _min_cppstd(self):
return 17
return 20

@property
def _min_msvc_compiler_version(self):
Expand All @@ -80,8 +80,8 @@ def _min_msvc_compiler_version(self):
@property
def _min_clang_compiler_version(self):
# NOTE: the latest bedrock server for Linux is compiled with Clang 15.0.7,
# but it should be ABI compatible with Clang 5
return 5
# but it should be ABI compatible with Clang 10
return 10

@property
def _devtools_enabled(self):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ config = ["tools.cmake.cmaketoolchain:generator=Ninja"]

[[tool.scikit-build-core-conan.overrides]]
if.platform-system = "win32"
settings = ["compiler.cppstd=17"]
settings = ["compiler.cppstd=20"]

[[tool.scikit-build-core-conan.overrides]]
if.platform-system = "linux"
settings = ["compiler.cppstd=gnu17", "compiler.libcxx=libc++"]
settings = ["compiler.cppstd=20", "compiler.libcxx=libc++"]

[tool.setuptools_scm]
write_to = "python/src/endstone/_internal/version.py"
Expand Down

0 comments on commit 8556841

Please sign in to comment.