1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Add custom build to Ruby for scanner library

This commit is contained in:
joshvera 2017-01-31 12:45:09 -05:00
parent 40b5c0c3ba
commit e0d363ebd0
2 changed files with 13 additions and 2 deletions

View File

@ -1,2 +1,13 @@
import Distribution.Simple
main = defaultMain
import Distribution.PackageDescription
import Distribution.Simple.Setup
import Distribution.Simple.Utils
main = defaultMainWithHooks simpleUserHooks { preConf = makeScannerLib }
makeScannerLib :: Args -> ConfigFlags -> IO HookedBuildInfo
makeScannerLib _ flags = do
let verbosity = fromFlag $ configVerbosity flags
rawSystemExit verbosity "env" ["mkdir", "-p", "lib"]
rawSystemExit verbosity "env" ["gcc", "-std=c++11", "-Ivendor/tree-sitter-ruby/src/", "-fPIC", "vendor/tree-sitter-ruby/src/scanner.cc", "-c", "-o", "lib/scanner.o"]
rawSystemExit verbosity "env" ["ar", "rcvs", "lib/libscanner.a", "lib/scanner.o"]
pure emptyHookedBuildInfo

View File

@ -7,7 +7,7 @@ author: semantic-code
maintainer: tclem@github.com
copyright: 2017 GitHub
category: Web
build-type: Simple
build-type: Custom
-- extra-source-files:
cabal-version: >=1.10