mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Merge pull request #2215 from github/avoid-recompiling-git
Prevent unnecessary recompilation of Semantic.Version in dev mode.
This commit is contained in:
commit
3ae2ddf7be
@ -293,7 +293,7 @@ library
|
|||||||
, StrictData
|
, StrictData
|
||||||
, TypeApplications
|
, TypeApplications
|
||||||
if flag(release)
|
if flag(release)
|
||||||
ghc-options: -Wall -Werror -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -O1 -j
|
ghc-options: -Wall -Werror -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -O1 -j -DCOMPUTE_GIT_SHA
|
||||||
else
|
else
|
||||||
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -O0 -j +RTS -A128m -n2m -RTS
|
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -O0 -j +RTS -A128m -n2m -RTS
|
||||||
ghc-prof-options: -fprof-auto
|
ghc-prof-options: -fprof-auto
|
||||||
@ -302,7 +302,7 @@ executable semantic
|
|||||||
hs-source-dirs: app
|
hs-source-dirs: app
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
if flag(release)
|
if flag(release)
|
||||||
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O1 -j
|
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O1 -j -DCOMPUTE_GIT_SHA
|
||||||
else
|
else
|
||||||
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O0 -j
|
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O0 -j
|
||||||
cc-options: -DU_STATIC_IMPLEMENTATION=1
|
cc-options: -DU_STATIC_IMPLEMENTATION=1
|
||||||
|
@ -1,17 +1,27 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
|
#ifdef COMPUTE_GIT_SHA
|
||||||
{-# OPTIONS_GHC -fforce-recomp #-} -- So that gitHash is correct.
|
{-# OPTIONS_GHC -fforce-recomp #-} -- So that gitHash is correct.
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
#endif
|
||||||
module Semantic.Version
|
module Semantic.Version
|
||||||
( buildSHA
|
( buildSHA
|
||||||
, buildVersion
|
, buildVersion
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Version (showVersion)
|
import Data.Version (showVersion)
|
||||||
|
#ifdef COMPUTE_GIT_SHA
|
||||||
import Development.GitRev
|
import Development.GitRev
|
||||||
|
#endif
|
||||||
import Paths_semantic (version)
|
import Paths_semantic (version)
|
||||||
|
|
||||||
-- The SHA1 hash of this build of semantic.
|
-- The SHA1 hash of this build of semantic.
|
||||||
|
-- If compiled as a development build, this will be @<development>@.
|
||||||
buildSHA :: String
|
buildSHA :: String
|
||||||
|
#ifdef COMPUTE_GIT_SHA
|
||||||
buildSHA = $(gitHash)
|
buildSHA = $(gitHash)
|
||||||
|
#else
|
||||||
|
buildSHA = "<development>"
|
||||||
|
#endif
|
||||||
|
|
||||||
-- The version string of this build of semantic.
|
-- The version string of this build of semantic.
|
||||||
buildVersion :: String
|
buildVersion :: String
|
||||||
|
Loading…
Reference in New Issue
Block a user