Skip to content

Commit 61cf4fb

Browse files
brindoschPaulchen-Panther
authored andcommitted
Windows compilation support (hyperion-project#738)
* Disable AVAHI * Replace SysInfo backport with Qt SysInfo * Update vscode config * Update LedDevices * Update Logger * Update hyperiond * Update hyperion-remote * Exclude avahi * Empty definition for Process * PythonInit path broken * Exclude PiBlaster and link ws2_32 * more avahi * resolve ui bug * Update Compile howto * JsonAPI QtGrabber missing * fix error * ssize_t replacement * Nope, doesn't work * Adjust compile description and verify winSDK * Update ci script * Update ci script * Update ci * Update ci script * update Logger * Update PythonInit * added Azure & GitHub Actions, Logger, PythonInit * resolve merge conflicts * revert ssize_t in FadeCandy * look at registry for QT5 & use find_package(Python) if cmake >= 3.12 * second try * another try * and yet another test * qt5 registry search undone * Package creation test * finished package creation. only fine tuning is required :-) Signed-off-by: Paulchen-Panther <[email protected]> * Dependencies for Windows finished Signed-off-by: Paulchen-Panther <[email protected]> * use 'add_definitions()' until CMake 3.12 Signed-off-by: Paulchen-Panther <[email protected]> * Update .github/workflows/pull-request.yml Co-Authored-By: Paulchen Panther <[email protected]> * Update cmake/Dependencies.cmake Co-Authored-By: brindosch <[email protected]> * fix typo/ add VCINSTALLDIR var * fix again * Undo change again (Not working) * fix QT grabber Signed-off-by: Paulchen-Panther <[email protected]> * first NSIS test Signed-off-by: Paulchen-Panther <[email protected]> * Update NSIS package * surprise :-) Signed-off-by: Paulchen-Panther <[email protected]> * Update NSIS package * fix: NSIS .bmps * Add nsis templates * Force windows gui app * fix: QSysInfo required Qt5.6, now it's 5.4 again * Update: Remove platform component and adjust package name * Add macOS as system name * Update docs * fix: Allow gh actions ci also for forks with branches * Add ReadMe docs, mention windows, add vscode linux debug config * fix: readme visual * reduce/hide banner/copyright/log message Infos here: https://docs.microsoft.com/de-de/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2019#switches * Fix PythonInit * vscode: Add runner task * fix(vscode): compiler path gcc ver independent * fix azure * vscode: add windows run tasks * move process detection * main: add windows process detection * Azure file shredder * Update docs Co-authored-by: Paulchen Panther <[email protected]> Co-authored-by: Paulchen-Panther <[email protected]>
1 parent 210e92c commit 61cf4fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3185
-872
lines changed

.azure.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,35 @@ jobs:
6161
env:
6262
PLATFORM: 'osx'
6363
condition: succeeded()
64-
displayName: 'Build macOS 10.13 packages'
64+
displayName: 'Build macOS 10.13 packages'
65+
66+
######################
67+
###### windows #######
68+
######################
69+
70+
- job: windows
71+
timeoutInMinutes: 120
72+
pool:
73+
vmImage: 'windows-latest'
74+
75+
steps:
76+
- checkout: self # represents the repo where the initial Pipelines YAML file was found
77+
submodules: recursive # set to 'recursive' to get submodules of submodules
78+
79+
- task: UsePythonVersion@0
80+
inputs:
81+
versionSpec: '3.x'
82+
addToPath: true
83+
architecture: 'x64'
84+
85+
- script: |
86+
cd $(Build.SourcesDirectory)
87+
python -m pip install aqtinstall
88+
python -m aqt install -O c:\Qt 5.14.0 windows desktop win64_msvc2017_64
89+
displayName: 'Install Qt 5.14.0'
90+
# build process
91+
- bash: ./.ci/ci_build.sh
92+
env:
93+
PLATFORM: 'windows'
94+
condition: succeeded()
95+
displayName: 'Build windows packages'

.ci/ci_build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
# detect CI
44
if [ "$SYSTEM_COLLECTIONID" != "" ]; then
55
# Azure Pipelines
6+
echo "Azure detected"
67
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
78
CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY"
89
elif [ "$HOME" != "" ]; then
910
# GitHub Actions
11+
echo "Github Actions detected"
1012
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
1113
CI_BUILD_DIR="$GITHUB_WORKSPACE"
1214
else
@@ -34,6 +36,15 @@ if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
3436
cd ${CI_BUILD_DIR} && source /${CI_BUILD_DIR}/test/testrunner.sh || exit 4
3537
exit 0;
3638
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
39+
elif [[ $CI_NAME == *"mingw64_nt"* || "$CI_NAME" == 'windows_nt' ]]; then
40+
# compile prepare
41+
echo "Number of Cores $NUMBER_OF_PROCESSORS"
42+
mkdir build || exit 1
43+
cd build
44+
cmake -G "Visual Studio 16 2019" -A x64 -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../ || exit 2
45+
cmake --build . --target package --config Release -- -nologo -v:m -maxcpucount || exit 3
46+
exit 0;
47+
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
3748
elif [[ "$CI_NAME" == 'linux' ]]; then
3849
echo "Compile Hyperion with DOCKER_TAG = ${DOCKER_TAG} and friendly name DOCKER_NAME = ${DOCKER_NAME}"
3950
# take ownership of deploy dir

.ci/ci_install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ if [[ $CI_NAME == 'osx' || $CI_NAME == 'darwin' ]]; then
3838
brew update
3939
dependencies=("qt5" "python" "libusb" "cmake" "doxygen")
4040
installAndUpgrade "${dependencies[@]}"
41+
# github actions uname -> windows-2019 -> mingw64_nt-10.0-17763
42+
# TODO: Azure uname windows?
43+
elif [[ $CI_NAME == *"mingw64_nt"* ]]; then
44+
echo "Yes, we are Windows: $CI_NAME"
45+
# Windows has no dependency manager
4146
elif [[ $CI_NAME != 'linux' ]]; then
4247
echo "Unsupported platform: $CI_NAME"
4348
exit 5

.github/workflows/pull-request.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,68 @@ jobs:
114114
name: macOS.zip
115115
path: macOS
116116

117+
######################
118+
###### Windows #######
119+
######################
120+
121+
windows:
122+
name: Windows
123+
runs-on: windows-latest
124+
steps:
125+
- name: Checkout
126+
uses: actions/checkout@v1
127+
with:
128+
submodules: true
129+
130+
# Append PR number to version
131+
- name: Append PR number to version
132+
shell: bash
133+
run: |
134+
tr -d '\n' < version > temp && mv temp version
135+
echo -n "-PR#${{ github.event.pull_request.number }}" >> version
136+
137+
- name: Install Qt
138+
uses: jurplel/install-qt-action@v2
139+
with:
140+
version: '5.14.1'
141+
target: 'desktop'
142+
arch: 'win64_msvc2017_64'
143+
144+
- name: Install Python
145+
uses: actions/setup-python@v1
146+
with:
147+
python-version: '3.x'
148+
149+
- name: Install NSIS
150+
run: |
151+
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/nsis/NSIS%203/3.05/nsis-3.05-setup.exe -OutFile nsis-setup.exe
152+
.\nsis-setup.exe /S
153+
154+
- name: Set up x64 build architecture environment
155+
shell: cmd
156+
run: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
157+
158+
# Build packages
159+
- name: Build packages
160+
env:
161+
VCINSTALLDIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
162+
PLATFORM: windows
163+
shell: bash
164+
run: ./.ci/ci_build.sh
165+
166+
# Collecting deployable artifacts
167+
- name: Collecting deployable artifacts
168+
shell: bash
169+
run: |
170+
mkdir -p windows
171+
mv build/*.zip windows
172+
# Upload artifacts
173+
- name: Upload artifacts
174+
uses: actions/upload-artifact@v1
175+
with:
176+
name: windows.zip
177+
path: windows
178+
117179
######################
118180
#### Documentation ###
119181
######################

.github/workflows/push-master.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,42 @@ jobs:
8585
with:
8686
path: build/Hyperion-*
8787

88+
######################
89+
###### Windows #######
90+
######################
91+
92+
windows:
93+
name: Windows
94+
runs-on: windows-latest
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v1
98+
with:
99+
submodules: true
100+
101+
- name: Install Qt
102+
uses: jurplel/install-qt-action@v2
103+
with:
104+
version: '5.14.1'
105+
target: 'desktop'
106+
arch: 'win64_msvc2017_64'
107+
108+
- name: Install Python
109+
uses: actions/setup-python@v1
110+
with:
111+
python-version: '3.x'
112+
113+
- name: Set up x64 build architecture environment
114+
shell: cmd
115+
run: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
116+
117+
# Build packages
118+
- name: Build packages
119+
env:
120+
PLATFORM: windows
121+
shell: bash
122+
run: ./.ci/ci_build.sh
123+
88124
######################
89125
#### Documentation ###
90126
######################

.vscode/c_cpp_properties.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,28 @@
77
"/usr/include/**"
88
],
99
"defines": [],
10-
"compilerPath": "/usr/bin/gcc-5",
10+
"compilerPath": "/usr/bin/gcc",
1111
"intelliSenseMode": "gcc-x64",
1212
"cppStandard": "c++11",
1313
"cStandard": "c11",
1414
"configurationProvider": "ms-vscode.cmake-tools"
15+
},
16+
{
17+
"name": "Win32",
18+
"includePath": [
19+
"${workspaceFolder}/**",
20+
"G:/Programme/Qt/5.14.1/msvc2017_64/include/**"
21+
],
22+
"defines": [
23+
"_DEBUG",
24+
"UNICODE",
25+
"_UNICODE"
26+
],
27+
"cStandard": "c11",
28+
"cppStandard": "c++11",
29+
"intelliSenseMode": "msvc-x64",
30+
"configurationProvider": "ms-vscode.cmake-tools"
1531
}
1632
],
1733
"version": 4
18-
}
34+
}

.vscode/hyperion.code-workspace

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "../"
5+
}
6+
],
7+
"settings": {
8+
"editor.formatOnSave": false,
9+
"cmake.environment": {
10+
"Qt5_DIR":"G:/Programme/Qt/5.14.1/msvc2017_64/lib/cmake/Qt5",
11+
"CMAKE_PREFIX_PATH": "G:/Programme/Qt/5.14.1/msvc2017_64"
12+
},
13+
},
14+
"extensions": {
15+
"recommendations": [
16+
"twxs.cmake",
17+
"ms-vscode.cpptools",
18+
"ms-vscode.cmake-tools",
19+
"spmeesseman.vscode-taskexplorer",
20+
"yzhang.markdown-all-in-one",
21+
"formulahendry.auto-rename-tag",
22+
"CoenraadS.bracket-pair-colorizer",
23+
"eamodio.gitlens",
24+
"vscode-icons-team.vscode-icons",
25+
"editorconfig.editorconfig"
26+
]
27+
}
28+
}

.vscode/launch.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "(Linux) hyperiond",
9+
"type": "cppdbg",
10+
"request": "launch",
11+
"program": "${workspaceFolder}/build/bin/hyperiond",
12+
"args": [],
13+
"stopAtEntry": false,
14+
"cwd": "${workspaceFolder}",
15+
"environment": [],
16+
"externalConsole": false,
17+
"MIMode": "gdb",
18+
"setupCommands": [
19+
{
20+
"description": "Enable pretty-printing for gdb",
21+
"text": "-enable-pretty-printing",
22+
"ignoreFailures": true
23+
}
24+
]
25+
},
26+
{
27+
"name": "(Windows) hyperiond",
28+
"type": "cppvsdbg",
29+
"request": "launch",
30+
"program": "${workspaceFolder}/build/bin/hyperiond.exe",
31+
"args": [],
32+
"stopAtEntry": false,
33+
"cwd": "${workspaceFolder}",
34+
"environment": [],
35+
"externalConsole": false
36+
}
37+
]
38+
}

0 commit comments

Comments
 (0)