Skip to content

Commit a8af67f

Browse files
authored
Merge pull request #111 from zephir-lang/#110-win-builds
#110 - Windows builds
2 parents f51e5f3 + 2590e36 commit a8af67f

File tree

12 files changed

+759
-96
lines changed

12 files changed

+759
-96
lines changed

.ci/AppVeyor.psm1

Lines changed: 0 additions & 75 deletions
This file was deleted.

.ci/build-win32.bat

Lines changed: 0 additions & 19 deletions
This file was deleted.

.ci/lemon-parser.ps1

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file is part of the Zephir Parser.
2+
#
3+
# (c) Zephir Team <team@zephir-lang.com>
4+
#
5+
# For the full copyright and license information, please view
6+
# the LICENSE file that was distributed with this source code.
7+
8+
Write-Output "-- Compiling Lemon parser..."
9+
$LemonSrc = Join-Path -Path './parser' -ChildPath 'lemon.c'
10+
$LemonBin = Join-Path -Path './parser' -ChildPath 'lemon.exe'
11+
12+
if ($IsWindows) {
13+
& cl /Fe${LemonExe} ${LemonSrc}
14+
}
15+
else {
16+
$LemonBin = Join-Path -Path './parser' -ChildPath 'lemon'
17+
& gcc ${LemonSrc} -o ${LemonBin}
18+
}
19+
& ${LemonBin} -x
20+
21+
Write-Output "-- Cleanup initial file state..."
22+
23+
$AutoFiles = "./parser/zephir.c",
24+
"./parser/zephir.h",
25+
"./parser/parser.c",
26+
"./parser/scanner.c"
27+
28+
foreach ($GeneratedFile in $AutoFiles) {
29+
if (Test-Path -Path $GeneratedFile) {
30+
Remove-Item $GeneratedFile
31+
}
32+
}
33+
34+
Write-Output "-- Run re2c..."
35+
& re2c -o (Join-Path -Path './parser' -ChildPath 'scanner.c') (Join-Path -Path './parser' -ChildPath 'scanner.re')
36+
37+
Write-Output "-- Generating zephir.c file with lemon parser..."
38+
& ${LemonBin} -s (Join-Path -Path './parser' -ChildPath 'zephir.lemon')
39+
40+
Write-Output "-- Generating parser.c file..."
41+
$ParserC = Join-Path -Path './parser' -ChildPath 'parser.c'
42+
$ZephirC = Join-Path -Path './parser' -ChildPath 'zephir.c'
43+
$BaseC = Join-Path -Path './parser' -ChildPath 'base.c'
44+
Set-Content -Path ${ParserC} -Value '#include <php.h>'
45+
Get-Content ${ZephirC}, ${BaseC} | Add-Content ${ParserC}

0 commit comments

Comments
 (0)