Skip to content

Commit

Permalink
substitute profiles options by proper procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
RickBarretto committed Nov 8, 2023
1 parent aba1556 commit 81c37ee
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
20 changes: 20 additions & 0 deletions .config/who.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

{. push used .}

proc releaseConfig() =
if hostOS=="windows":
--define:strip
else:
--define:strip
--passC:"'-flto'"
--passL:"'-flto'"

proc userConfig() =
releaseConfig()

proc devConfig() =
--define:DEV
--embedsrc:on
--listCmd

{. pop .}
34 changes: 4 additions & 30 deletions build.nims
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ template `---`*(key: untyped, val: string): untyped =
flags.add("--" & stripStr(astToStr(key)) & ":" & val)

include ".config/arch.nims"
include ".config/who.nims"

#=======================================
# Constants
Expand Down Expand Up @@ -103,11 +104,6 @@ let
--debuginfo
--linedir:on
,
"dev": proc () {.closure.} =
--embedsrc:on
--define:DEV
--listCmd
,
"docgen": proc () {.closure.} =
--define:DOCGEN
,
Expand Down Expand Up @@ -138,9 +134,6 @@ let
"noclipboard": proc () {.closure.} =
--define:NOCLIPBOARD
,
"nodev": proc () {.closure.} =
discard
,
"nodialogs": proc () {.closure.} =
--define:NODIALOGS
,
Expand Down Expand Up @@ -175,14 +168,6 @@ let
--profiler:on
--stackTrace:on
,
"release": proc () {.closure.} =
if hostOS=="windows":
--define:strip
else:
--define:strip
--passC:"'-flto'"
--passL:"'-flto'"
,
"safe": proc () {.closure.} =
--define:SAFE
,
Expand Down Expand Up @@ -714,6 +699,7 @@ cmd install, "Build arturo and install executable":

if args.hasCommand("dev"):
IS_DEV = true
devConfig()

if args.hasCommand("dontcompress"):
COMPRESS = false
Expand All @@ -730,6 +716,7 @@ cmd install, "Build arturo and install executable":

if args.hasCommand("nodev"):
IS_DEV = false
userConfig()

if args.hasCommand("web"):
miniBuild()
Expand All @@ -751,11 +738,6 @@ cmd install, "Build arturo and install executable":
--debuginfo
--linedir:on

if args.hasCommand("dev"):
--embedsrc:on
--define:DEV
--listCmd

if args.hasCommand("docgen"):
--define:DOCGEN

Expand Down Expand Up @@ -786,9 +768,6 @@ cmd install, "Build arturo and install executable":
if args.hasCommand("noclipboard"):
--define:NOCLIPBOARD

if args.hasCommand("nodev"):
discard

if args.hasCommand("nodialogs"):
--define:NODIALOGS

Expand Down Expand Up @@ -824,12 +803,7 @@ cmd install, "Build arturo and install executable":
--stackTrace:on

if args.hasCommand("release"):
if hostOS=="windows":
--define:strip
else:
--define:strip
--passC:"'-flto'"
--passL:"'-flto'"
releaseConfig()

if args.hasCommand("safe"):
--define:SAFE
Expand Down

0 comments on commit 81c37ee

Please sign in to comment.