diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2018-04-11 20:48:33 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2018-04-11 20:48:33 +0300 |
| commit | c872f7d65b74f5f46a85a8df927af86c5178ad8a (patch) | |
| tree | fd75288c5cb32c8cb4c638e26fc9b2226a9730d2 /src/nimpb_build.nim | |
| parent | b083470799b4382c315b47dd92a69d5abc7d541c (diff) | |
| download | nimpb_protoc-c872f7d65b74f5f46a85a8df927af86c5178ad8a.tar.gz nimpb_protoc-c872f7d65b74f5f46a85a8df927af86c5178ad8a.zip | |
Rename to nimpb_protoc
Diffstat (limited to 'src/nimpb_build.nim')
| -rw-r--r-- | src/nimpb_build.nim | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/nimpb_build.nim b/src/nimpb_build.nim deleted file mode 100644 index 9a3f018..0000000 --- a/src/nimpb_build.nim +++ /dev/null @@ -1,50 +0,0 @@ -import os -import strformat - -when defined(windows): - const compilerId = "win32" -elif defined(linux): - when defined(i386): - const arch = "x86_32" - elif defined(amd64): - const arch = "x86_64" - elif defined(arm64): - const arch = "aarch_64" - else: - {.fatal:"unsupported architecture".} - const compilerId = "linux-" & arch -elif defined(macosx): - when defined(amd64): - const arch = "x86_64" - else: - {.fatal:"unsupported architecture".} - const compilerId = "osx-" & arch -else: - {.fatal:"unsupported platform".} - -when defined(windows): - const exeSuffix = ".exe" -else: - const exeSuffix = "" - -let - paths = @[ - # getAppDir() / "src" / "nimpb_buildpkg" / "protobuf", - # getAppDir() / "nimpb_buildpkg" / "protobuf", - parentDir(currentSourcePath()) / "nimpb_buildpkg" / "protobuf", - ] - -proc getCompilerPath*(): string = - let - compilerName = &"protoc-{compilerId}{exeSuffix}" - - for path in paths: - if fileExists(path / compilerName): - return path / compilerName - - raise newException(Exception, &"{compilerName} not found!") - -proc getProtoIncludeDir*(): string = - for path in paths: - if fileExists(path / "include"): - return path / "include" |
