Skip to content

Commit f8f16f7

Browse files
committed
Added circleci build for mingw
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
1 parent 97e14e9 commit f8f16f7

File tree

5 files changed

+51
-41
lines changed

5 files changed

+51
-41
lines changed

.circleci/config.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
version: 2.1
22

3+
orbs:
4+
win: circleci/windows@5.0 # The Windows orb gives you everything you need to start using the
5+
36
jobs:
47
build-linux-gcc:
58
machine:
@@ -39,7 +42,16 @@ jobs:
3942
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
4043
- store_artifacts:
4144
path: ./Release/Darwin/erpcgen/erpcgen
42-
45+
build-windows-mingw:
46+
executor:
47+
name: win/default
48+
size: large
49+
steps:
50+
- checkout
51+
- run: powershell.exe .\install_dependencies.ps1
52+
- run: powershell.exe .\mingw64\bin\mingw32-make erpcgen
53+
- store_artifacts:
54+
path: ./Release/MINGW/erpcgen/erpcgen.exe
4355

4456
workflows:
4557
build-workflow:
@@ -48,3 +60,4 @@ workflows:
4860
- build-linux-clang
4961
- build-mac-gcc
5062
- build-mac-clang
63+
- build-windows-mingw

erpcgen/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ ifeq "$(build)" "release"
112112
endif
113113
endif
114114

115+
ifeq "$(is_mingw)" "1"
115116
CXXFLAGS += -DBOOST_FILESYSTEM_VERSION=4
117+
endif
116118

117119
# Run flex
118120
$(OBJS_ROOT)/erpcgen_lexer.cpp: $(ERPC_ROOT)/erpcgen/src/erpcgen_lexer.l $(OBJS_ROOT)/erpcgen_parser.tab.hpp | $(OBJECTS_DIRS)

install_dependencies.ps1

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,3 @@
1-
# Install 7zip
2-
$URL7Zip = "https://gist.githubusercontent.com/dansmith65/7dd950f183af5f5deaf9650f2ad3226c/raw/8b8f6e96de7469cea73c9fe63a5da4d44a7c1ba7/Install-7zip.ps1"
3-
$Path7Zip = ".\Install-7zip.ps1"
4-
Remove-Item -ErrorAction Ignore $Path7Zip
5-
Invoke-WebRequest -URI $URL7Zip -OutFile $Path7Zip
6-
powershell $Path7Zip
7-
Remove-Item -ErrorAction Ignore $Path7Zip
8-
$Path7zipApp="C:\Program Files\7-Zip\7z.exe"
9-
10-
# Install mingw
11-
$URLMingw = "https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev2/x86_64-12.2.0-release-win32-seh-ucrt-rt_v10-rev2.7z"
12-
$PathMingw7Zip = "mingw.7z"
13-
$PathMingw = "mingw64"
14-
$UnzipMingw = 'x',$PathMingw7Zip,'-y'
15-
Remove-Item -ErrorAction Ignore $PathMingw7Zip
16-
Remove-Item -ErrorAction Ignore $PathMingw
17-
Invoke-WebRequest -URI $URLMingw -OutFile $PathMingw7Zip
18-
& $Path7zipApp $UnzipMingw
19-
Remove-Item -ErrorAction Ignore $PathMingw7Zip
20-
21-
# Install boost
22-
$PathBoostFolder="boost_1_81_0"
23-
$URLBoost = "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/" + $PathBoostFolder + ".7z"
24-
$PatHBoost7Zip=".\boost.7z"
25-
$UnzipBoost = 'x',$PatHBoost7Zip,'-y'
26-
Remove-Item -ErrorAction Ignore $PatHBoost7Zip
27-
Remove-Item -ErrorAction Ignore $PathBoostFolder
28-
Invoke-WebRequest -URI $URLBoost -OutFile $PatHBoost7Zip
29-
& $Path7zipApp $UnzipBoost
30-
Remove-Item -ErrorAction Ignore $PatHBoost7Zip
31-
$env:Path += ';'+(Get-Location).tostring() + "\" + $PathMingw+"\bin"
32-
33-
Set-Location ".\"$PathBoostFolder
34-
.\bootstrap.bat gcc
35-
.\b2 --build-type=complete toolset=gcc install
36-
Set-Location "..\"
37-
381
# Binson/flex
392
Set-Location ".\erpcgen\VisualStudio_v14"
403
$PatHBisonFlex7Zip=".\win_flex_bison.zip"
@@ -56,3 +19,31 @@ Move-Item -Path $PatHBisonFlexFull -Destination .\ -force
5619
Remove-Item -ErrorAction Ignore $PatHBisonFlex7Zip
5720
# Remove-Item -ErrorAction Ignore -Recurse $PatHBisonFlex
5821
Set-Location "..\..\"
22+
23+
if ($args[0] -eq "VS")
24+
{
25+
# winget install --id=Microsoft.VisualStudio.2019.BuildTools -e
26+
# & 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe' .\erpcgen\VisualStudio_v14\erpcgen.sln /property:Configuration=Release
27+
}
28+
else
29+
{
30+
# Install 7zip
31+
$URL7Zip = "https://gist.githubusercontent.com/dansmith65/7dd950f183af5f5deaf9650f2ad3226c/raw/8b8f6e96de7469cea73c9fe63a5da4d44a7c1ba7/Install-7zip.ps1"
32+
$Path7Zip = ".\Install-7zip.ps1"
33+
Remove-Item -ErrorAction Ignore $Path7Zip
34+
Invoke-WebRequest -URI $URL7Zip -OutFile $Path7Zip
35+
powershell $Path7Zip
36+
Remove-Item -ErrorAction Ignore $Path7Zip
37+
$Path7zipApp="C:\Program Files\7-Zip\7z.exe"
38+
39+
# Install mingw
40+
$URLMingw = "https://github.com/niXman/mingw-builds-binaries/releases/download/12.2.0-rt_v10-rev2/x86_64-12.2.0-release-win32-seh-ucrt-rt_v10-rev2.7z"
41+
$PathMingw7Zip = "mingw.7z"
42+
$PathMingw = "mingw64"
43+
$UnzipMingw = 'x',$PathMingw7Zip,'-y'
44+
Remove-Item -ErrorAction Ignore $PathMingw7Zip
45+
Remove-Item -ErrorAction Ignore -Recurse $PathMingw
46+
Invoke-WebRequest -URI $URLMingw -OutFile $PathMingw7Zip
47+
& $Path7zipApp $UnzipMingw
48+
Remove-Item -ErrorAction Ignore $PathMingw7Zip
49+
}

mk/common.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ ifeq "$(os_name)" ""
6161
os_name := $(shell powershell [System.Environment]::OSVersion.Version)
6262
ifneq "$(os_name)" ""
6363
is_mingw := 1
64-
os_name = MINGW
6564
endif
6665
else
6766
# Set to 1 if running on Darwin.
@@ -76,7 +75,11 @@ else
7675
# Set to 1 if running on Linux.
7776
is_linux := $(and $(findstring Linux,$(os_name)),1)
7877

79-
is_mingw := 0
78+
is_mingw := $(and $(findstring MSYS_NT,$(os_name)),1)
79+
endif
80+
81+
ifeq "$(is_mingw)" "1"
82+
os_name = MINGW64
8083
endif
8184

8285
#-------------------------------------------------------------------------------

mk/paths.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ TEST_ROOT := $(ERPC_ROOT)/test
2727
ifeq "$(is_mingw)" "1"
2828
VISUAL_STUDIO_ROOT ?= $(ERPC_ROOT)/erpcgen/VisualStudio_v14
2929
MINGW64 ?= $(ERPC_ROOT)/mingw64
30+
export PATH := $(MINGW64):$(MINGW64)/bin:$(PATH)
3031
CC = gcc
3132
CXX = g++
3233
endif
@@ -94,7 +95,7 @@ else ifeq "$(is_mingw)" "1"
9495
endif
9596

9697
ifeq "$(is_mingw)" "1"
97-
MAKE := mingw32-make
98+
MAKE := $(MINGW64)/bin/mingw32-make
9899
POWERSHELL ?= powershell
99100
mkdirc = $(POWERSHELL) mkdir -Force
100101
rmc = $(POWERSHELL) rm -Recurse -Force -ErrorAction Ignore

0 commit comments

Comments
 (0)