Skip to content

Commit a1b257e

Browse files
committed
First version
0 parents  commit a1b257e

6 files changed

Lines changed: 65 additions & 0 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
Package.resolved
6+
*~

Package.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// swift-tools-version:4.2
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "IgisShellD",
8+
dependencies: [
9+
],
10+
targets: [
11+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
12+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
13+
.target(
14+
name: "IgisShellD"),
15+
]
16+
)

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# IgisShellD
2+
3+
An empty shell to serve as a starting point for using Igis as a dynamically linked library.
4+
Before use, build Igis and set the LD_LIBRARY_PATH environment variable to include the
5+
library's location.
6+
7+
Then use make.sh to build the project and run.sh to run the project.
8+

Sources/IgisShellD/main.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Igis
2+
3+
class Painter : PainterBase {
4+
5+
6+
required init() {
7+
}
8+
9+
override func setup(canvas:Canvas) {
10+
}
11+
12+
}
13+
14+
print("Starting...")
15+
do {
16+
let igis = Igis()
17+
try igis.run(painterType:Painter.self)
18+
} catch (let error) {
19+
print("Error: \(error)")
20+
}
21+

make.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if [[ -z "$LD_LIBRARY_PATH" ]]; then
3+
echo "Must provide LD_LIBRARY_PATH in environment" 1>&2
4+
exit 1
5+
fi
6+
echo "LD_LIBRARY_PATH at $LD_LIBRARY_PATH"
7+
swift build -Xswiftc -I -Xswiftc $LD_LIBRARY_PATH -Xswiftc -L -Xswiftc $LD_LIBRARY_PATH -Xswiftc -lIgis --verbose

run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if [[ -z "$LD_LIBRARY_PATH" ]]; then
3+
echo "Must provide LD_LIBRARY_PATH in environment" 1>&2
4+
exit 1
5+
fi
6+
echo "LD_LIBRARY_PATH at $LD_LIBRARY_PATH"
7+
swift run -Xswiftc -I -Xswiftc $LD_LIBRARY_PATH -Xswiftc -L -Xswiftc $LD_LIBRARY_PATH -Xswiftc -lIgis --verbose

0 commit comments

Comments
 (0)