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
17 changes: 14 additions & 3 deletions pkgs/o/opencv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
-- Optional features (0.0.4+, mcpp#243 forwarding): `dnn` adds the
-- import opencv.dnn; interface and forwards compat.opencv/dnn; `unifont`
-- forwards compat.opencv/unifont — `opencv = { features = ["dnn"] }`.
-- linux + macOS: the module tarball is OS-neutral; compat.opencv is per-OS
-- (linux/macosx full). v0.0.6 added the clang static-inline export forwarding
-- layer so clang (macOS) can import opencv.cv. windows: module needs videoio.
-- 3-platform: the module tarball is OS-neutral; compat.opencv is per-OS (all
-- three now full — videoio everywhere, dnn on linux/macOS/windows). v0.0.6's
-- clang static-inline export forwarding layer lets clang (macOS + windows
-- clang-cl) import opencv.cv; windows dnn uses the built-in fast_gemm backend
-- (compat.opencv skips mlas there — its x86 asm is GAS/ELF, not COFF).
--
package = {
spec = "1",
Expand Down Expand Up @@ -42,6 +44,15 @@ package = {
sha256 = "adebd6b1e7a434bf8d744a6fc191725466467ae13b4d7ee1c01d5a8e21bbf2eb",
},
},
windows = {
["0.0.6"] = {
url = {
GLOBAL = "https://github.com/Sunrisepeak/opencv-m/archive/refs/tags/v0.0.6.tar.gz",
CN = "https://gitcode.com/mcpp-res/opencv/releases/download/v0.0.6/opencv-m-0.0.6.tar.gz",
},
sha256 = "adebd6b1e7a434bf8d744a6fc191725466467ae13b4d7ee1c01d5a8e21bbf2eb",
},
},
},

-- (no `mcpp` field -- default lookup will find <verdir>/*/mcpp.toml)
Expand Down
4 changes: 4 additions & 0 deletions tests/examples/opencv-module-dnn/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ opencv = { version = "0.0.6", features = ["dnn"] }
[target.'cfg(macos)'.dependencies]
opencv = { version = "0.0.6", features = ["dnn"] }

# windows: `import opencv.dnn;` on windows-x86_64 (fast_gemm backend).
[target.'cfg(windows)'.dependencies]
opencv = { version = "0.0.6", features = ["dnn"] }


Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Linux-only (see mcpp.toml). Not named dnn.cpp (would collide with the dep's
// modules/dnn/src/dnn.cpp — #240 family). Import-only (import std + the opencv
// modules): no textual headers, matching the ffmpeg-module member convention.
#if defined(__linux__) || defined(__APPLE__)
#if defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
import std;
import opencv.cv;
import opencv.dnn;
Expand Down
4 changes: 4 additions & 0 deletions tests/examples/opencv-module/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ opencv = "0.0.6"

[target.'cfg(macos)'.dependencies]
opencv = "0.0.6"

# windows: import opencv.cv on windows-x86_64 (clang-cl; module tarball OS-neutral).
[target.'cfg(windows)'.dependencies]
opencv = "0.0.6"
2 changes: 1 addition & 1 deletion tests/examples/opencv-module/tests/opencv_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// replacement operator surface: Size comparison via != crosses the module
// boundary — the v0.0.1 regression scenario), PNG+JPEG codec roundtrips,
// videoio registry. Linux-only (see mcpp.toml).
#if defined(__linux__) || defined(__APPLE__)
#if defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
import std;
import opencv.cv;

Expand Down
Loading