Skip to content

Commit 97b0123

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

File tree

4 files changed

+47
-41
lines changed

4 files changed

+47
-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+
# "https://aka.ms/vs/17/release/vs_BuildTools.exe"
26+
# ""
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/paths.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ 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-
CC = gcc
31-
CXX = g++
30+
CC = $(ERPC_ROOT)/mingw64/bin/gcc
31+
CXX = $(ERPC_ROOT)/mingw64/bin/g++
3232
endif
3333

3434
TARGET_OUTPUT_ROOT = $(OUTPUT_ROOT)/$(DEBUG_OR_RELEASE)/$(os_name)/$(APP_NAME)
@@ -94,7 +94,7 @@ else ifeq "$(is_mingw)" "1"
9494
endif
9595

9696
ifeq "$(is_mingw)" "1"
97-
MAKE := mingw32-make
97+
MAKE := $(MINGW64)/bin/mingw32-make
9898
POWERSHELL ?= powershell
9999
mkdirc = $(POWERSHELL) mkdir -Force
100100
rmc = $(POWERSHELL) rm -Recurse -Force -ErrorAction Ignore

0 commit comments

Comments
 (0)