aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2020-11-17 09:48:31 -0600
committerCalvin Rose <calsrose@gmail.com>2020-11-17 09:53:12 -0600
commit2dc04d2957ef2f93aea1a83f4f55d11fbeebc6e2 (patch)
tree78c152bcd5b9f783aa0288976f91c69676ec54ee /tools
parentMerge branch 'master' of github.com:janet-lang/janet (diff)
On install, merge janetconf.h into janet.h
This results in a cleaner amalgmated build
Diffstat (limited to 'tools')
-rw-r--r--tools/msi/janet.wxs3
-rw-r--r--tools/patch-header.janet12
2 files changed, 12 insertions, 3 deletions
diff --git a/tools/msi/janet.wxs b/tools/msi/janet.wxs
index c747b0d4..80a0b7e4 100644
--- a/tools/msi/janet.wxs
+++ b/tools/msi/janet.wxs
@@ -127,9 +127,6 @@
<RemoveFolder Id="RemoveCDir" On="uninstall" />
</Component>
<Component Directory="CDir">
- <File Source="dist\janetconf.h"/>
- </Component>
- <Component Directory="CDir">
<File Source="dist\janet.lib"/>
</Component>
<Component Directory="CDir">
diff --git a/tools/patch-header.janet b/tools/patch-header.janet
new file mode 100644
index 00000000..bbc86653
--- /dev/null
+++ b/tools/patch-header.janet
@@ -0,0 +1,12 @@
+# Patch janet.h
+
+(def [_ janeth janetconf output] (dyn :args))
+
+(def- replace-peg
+ (peg/compile
+ ~(% (* '(to `#include "janetconf.h"`)
+ (constant ,(slurp janetconf))
+ (thru `#include "janetconf.h"`)
+ '(any 1)))))
+
+(spit output (first (peg/match replace-peg (slurp janeth))))