Skip to content

Commit 04df346

Browse files
tz12323Copilot
andcommitted
feat: add richdem package
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2461f18 commit 04df346

4 files changed

Lines changed: 74 additions & 0 deletions

File tree

‎mcpp.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ members = [
8585
"tests/examples/openssl",
8686
"tests/examples/recastnavigation",
8787
"tests/examples/recastnavigation-features",
88+
"tests/examples/richdem",
8889
"tests/examples/protobuf",
8990
"tests/examples/protobuf-upb",
9091
"tests/examples/protobuf-gzip",

‎pkgs/r/compat.richdem.lua‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
-- Form B inline descriptor for RichDEM, a C++ library for high-performance
2+
-- terrain analysis.
3+
--
4+
-- RichDEM's public headers are under include/richdem and its standalone
5+
-- library sources are under src/. GDAL support is optional upstream: enabling
6+
-- the feature matches CMake's USE_GDAL option by defining USEGDAL and adding
7+
-- the GDAL implementation source. Consumers enabling that feature must also
8+
-- provide GDAL headers and the GDAL library in their environment.
9+
package = {
10+
spec = "1",
11+
namespace = "compat",
12+
name = "richdem",
13+
description = "High-performance terrain analysis library",
14+
licenses = {"MIT"},
15+
repo = "https://github.com/r-barnes/richdem",
16+
type = "package",
17+
18+
xpm = {
19+
linux = {
20+
["2.2.11"] = {
21+
url = "https://github.com/r-barnes/richdem/archive/9a1c97bb2529e386451a7dd54768b8b74bb4d620.tar.gz",
22+
sha256 = "bfa98d00d1d1f3529b2efc6907c9977e65a3c3071f46e24f468fa0db0dc6118b",
23+
},
24+
},
25+
macosx = {
26+
["2.2.11"] = {
27+
url = "https://github.com/r-barnes/richdem/archive/9a1c97bb2529e386451a7dd54768b8b74bb4d620.tar.gz",
28+
sha256 = "bfa98d00d1d1f3529b2efc6907c9977e65a3c3071f46e24f468fa0db0dc6118b",
29+
},
30+
},
31+
windows = {
32+
["2.2.11"] = {
33+
url = "https://github.com/r-barnes/richdem/archive/9a1c97bb2529e386451a7dd54768b8b74bb4d620.tar.gz",
34+
sha256 = "bfa98d00d1d1f3529b2efc6907c9977e65a3c3071f46e24f468fa0db0dc6118b",
35+
},
36+
},
37+
},
38+
39+
mcpp = {
40+
language = "c++23",
41+
import_std = false,
42+
c_standard = "c11",
43+
include_dirs = { "*/include" },
44+
sources = {
45+
"*/src/richdem.cpp",
46+
"*/src/random.cpp",
47+
"*/src/terrain_generation/terrain_generation.cpp",
48+
"*/src/terrain_generation/PerlinNoise.cpp",
49+
},
50+
targets = { ["richdem"] = { kind = "lib" } },
51+
features = {
52+
["gdal"] = {
53+
defines = { "USEGDAL" },
54+
sources = { "*/src/gdal.cpp" },
55+
},
56+
},
57+
deps = {},
58+
},
59+
}

‎tests/examples/richdem/mcpp.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "richdem-tests"
3+
version = "0.1.0"
4+
5+
[dependencies.compat]
6+
richdem = "2.2.11"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <richdem/common/constants.hpp>
2+
#include <richdem/common/random.hpp>
3+
4+
int main() {
5+
richdem::seed_rand(1);
6+
const auto value = richdem::uniform_rand_int(1, 10);
7+
return value >= 1 && value <= 10 ? 0 : 1;
8+
}

0 commit comments

Comments
 (0)