Skip to content

Commit 7d52f66

Browse files
Add Linux build
1 parent 0008fad commit 7d52f66

5 files changed

Lines changed: 31 additions & 61 deletions

File tree

.github/workflows/prebuild.yml

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
os: [macos-11, windows-2022]
12+
os: [macos-11, ubuntu-22.04, windows-2022]
1313

1414
steps:
1515
- if: matrix.os == 'windows-2022'
@@ -38,23 +38,20 @@ jobs:
3838
cmake --build . --target install
3939
python3 ../scripts/bundle.py mac release done
4040
41-
# - if: matrix.os == 'macos-11'
42-
# name: Build - Debug (MacOS)
43-
# run: |
44-
# rm -r builddir
45-
# rm -r openssl/builddir
46-
47-
# cd openssl
48-
# meson setup builddir --buildtype=debug
49-
# meson compile -C builddir
50-
# cd ..
51-
# mkdir -p builddir
52-
# cd builddir
53-
# cp -r ../openssl/subprojects/openssl-3.0.2/generated-config/archs/darwin64-x86_64-cc/asm/include ../openssl/subprojects/openssl-3.0.2
54-
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF
55-
# cmake --build . --config Debug -- -j8
56-
# cmake --build . --target install
57-
# python3 ../scripts/bundle.py debug done
41+
- if: matrix.os == 'ubuntu-22.04'
42+
name: Build - Release (Linux)
43+
run: |
44+
cd openssl
45+
meson setup builddir --buildtype=release
46+
meson compile -C builddir
47+
cd ..
48+
mkdir -p builddir
49+
cd builddir
50+
cp -r ../openssl/subprojects/openssl-3.0.2/generated-config/archs/linux-x86_64/asm/include ../openssl/subprojects/openssl-3.0.2
51+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF
52+
cmake --build . --config Release -- -j8
53+
cmake --build . --target install
54+
python3 ../scripts/bundle.py linux release done
5855
5956
- if: matrix.os == 'windows-2022'
6057
name: Build - Release /MT (Windows)
@@ -89,42 +86,6 @@ jobs:
8986
cmake --build . --target install
9087
python3 ../scripts/bundle.py win release_md done
9188
92-
# - if: matrix.os == 'windows-2022'
93-
# name: Build - Debug /MT (Windows)
94-
# run: |
95-
# rm -r builddir
96-
# rm -r openssl/builddir
97-
98-
# cd openssl
99-
# meson setup builddir --buildtype=debug -Dmt=enabled
100-
# meson compile -C builddir
101-
# cd ..
102-
# mkdir -force builddir
103-
# cd builddir
104-
# cp -r -force ../openssl/subprojects/openssl-3.0.2/generated-config/archs/VC-WIN64A/no-asm/include ../openssl/subprojects/openssl-3.0.2
105-
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF -DPOCO_MT=ON
106-
# cmake --build . --config Debug
107-
# cmake --build . --target install
108-
# python3 ../scripts/bundle.py debug_mt
109-
110-
# - if: matrix.os == 'windows-2022'
111-
# name: Build - Debug /MD (Windows)
112-
# run: |
113-
# rm -r builddir
114-
# rm -r openssl/builddir
115-
116-
# cd openssl
117-
# meson setup builddir --buildtype=debug -Dmt=disabled
118-
# meson compile -C builddir
119-
# cd ..
120-
# mkdir -force builddir
121-
# cd builddir
122-
# cp -r -force ../openssl/subprojects/openssl-3.0.2/generated-config/archs/VC-WIN64A/no-asm/include ../openssl/subprojects/openssl-3.0.2
123-
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF -DPOCO_MT=OFF
124-
# cmake --build . --config Debug
125-
# cmake --build . --target install
126-
# python3 ../scripts/bundle.py debug_md done
127-
12889
- name: Upload
12990
uses: ncipollo/release-action@v1.10.0
13091
with:

openssl/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if host_machine.system() == 'windows'
1111
else
1212
add_global_arguments('/MD', language: 'c')
1313
endif
14-
else
14+
elif host_machine.system() == 'darwin'
1515
add_global_arguments('-mmacosx-version-min=10.15', language: 'c')
1616
endif
1717

scripts/bundle.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@
6969

7070
# zip
7171

72-
if platform.system() == 'Windows':
73-
bundlezip = curdir + '/poco-win'
74-
else:
75-
bundlezip = curdir + '/poco-mac'
72+
bundlezip = curdir + '/poco-' + opsys
7673

7774
if len(sys.argv) > 3:
7875
shutil.make_archive(bundlezip, 'zip', bundledir)

scripts/patch/globo

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ component = sys.argv[2]
88
if platform.system() == 'Windows':
99
for i in glob.glob('./win/' + config + '/' + component + '/*.obj'):
1010
print(i)
11-
else:
11+
elif platform.system() == 'Darwin':
1212
for i in glob.glob('./mac/' + config + '/' + component + '/*.o'):
1313
print(i)
14+
else:
15+
for i in glob.glob('./linux/' + config + '/' + component + '/*.o'):
16+
print(i)

scripts/patch/meson.build

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if host_machine.system() == 'windows'
1111
compile_args: ['-DPOCO_NO_AUTOMATIC_LIBS', '-DPOCO_STATIC', '/wd4127', '/wd4244', '/wd4245'],
1212
include_directories: 'win/include'
1313
)
14-
else
14+
elif host_machine.system() == 'darwin'
1515
platform = 'mac'
1616
config_mt = 'release'
1717
config_md = 'release'
@@ -20,6 +20,15 @@ else
2020
compile_args: ['-Wno-deprecated-declarations', '-Wno-sign-compare'],
2121
include_directories: 'mac/include'
2222
)
23+
else
24+
platform = 'linux'
25+
config_mt = 'release'
26+
config_md = 'release'
27+
28+
poco_dep = declare_dependency(
29+
compile_args: ['-Wno-deprecated-declarations', '-Wno-sign-compare'],
30+
include_directories: 'linux/include'
31+
)
2332
endif
2433

2534
cpp = meson.get_compiler('cpp')

0 commit comments

Comments
 (0)