Skip to content

Commit 50c0b5d

Browse files
authored
Merge pull request #3 from DenisKolodin/git-submodule
Add nativefiledialog as a git submodule
2 parents bc0d1fb + 1ddaee9 commit 50c0b5d

File tree

14 files changed

+46
-1625
lines changed

14 files changed

+46
-1625
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "nativefiledialog"]
2+
path = nativefiledialog
3+
url = https://github.com/mlabbe/nativefiledialog
4+
branch = master

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[package]
22
name = "nfd"
3-
version = "0.0.2"
4-
authors = ["Saurav Sachidanand <[email protected]>", "Daniel Collin <daniel@collin>"]
3+
version = "0.0.3"
4+
authors = [
5+
"Saurav Sachidanand <[email protected]>",
6+
"Daniel Collin <[email protected]>",
7+
"Denis Kolodin <[email protected]>",
8+
]
59

610
license = "MIT"
711
repository = "https://www.github.com/saurvs/nfd-rs"

appveyor.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
environment:
2+
matrix:
3+
- TARGET: x86_64-pc-windows-gnu
4+
MSYS_BITS: 64
5+
- TARGET: i686-pc-windows-gnu
6+
MSYS_BITS: 32
7+
- TARGET: x86_64-pc-windows-msvc
8+
- TARGET: i686-pc-windows-msvc
9+
10+
install:
11+
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe"
12+
- rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
13+
- set PATH=%PATH%;C:\Program Files (x86)\Rust\bin
14+
- if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
15+
- set CARGO_TARGET_DIR=%APPVEYOR_BUILD_FOLDER%\target
16+
- rustc -V
17+
- cargo -V
18+
19+
build: false
20+
21+
test_script:
22+
- git submodule update --init --recursive
23+
- cargo build --verbose
24+
- cargo test --verbose

build.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@ extern crate gcc;
2424
use std::env;
2525
use std::process::Command;
2626

27+
macro_rules! nfd {
28+
($suf:expr) => {
29+
concat!("nativefiledialog/src/", $suf);
30+
};
31+
}
32+
2733
fn main() {
2834
let mut cfg = gcc::Config::new();
2935
let env = env::var("TARGET").unwrap();
3036

31-
cfg.file("nfd/src/nfd_common.c");
37+
cfg.include(nfd!("include"));
38+
cfg.file(nfd!("nfd_common.c"));
3239

3340
if env.contains("darwin") {
34-
cfg.file("nfd/src/nfd_cocoa.m");
41+
cfg.file(nfd!("nfd_cocoa.m"));
3542
cfg.compile("libnfd.a");
3643
println!("cargo:rustc-link-lib=framework=AppKit");
3744
} else if env.contains("windows") {
38-
cfg.file("nfd/src/nfd_win.cpp");
45+
cfg.file(nfd!("nfd_win.cpp"));
3946
cfg.compile("libnfd.a");
4047
println!("cargo:rustc-link-lib=ole32");
4148
// MinGW doesn't link it by default
@@ -60,7 +67,7 @@ fn main() {
6067
}
6168
_ => (),
6269
}
63-
cfg.file("nfd/src/nfd_gtk.c");
70+
cfg.file(nfd!("nfd_gtk.c"));
6471
cfg.compile("libnfd.a");
6572
println!("cargo:rustc-link-lib=gdk-3");
6673
println!("cargo:rustc-link-lib=gtk-3");

nativefiledialog

Submodule nativefiledialog added at 2f729d3

nfd/LICENSE

Lines changed: 0 additions & 16 deletions
This file was deleted.

nfd/README.md

Lines changed: 0 additions & 137 deletions
This file was deleted.

nfd/src/common.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

nfd/src/include/nfd.h

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)