Skip to content

Commit

Permalink
Add Linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Sep 9, 2022
1 parent 0008fad commit 7d52f66
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 61 deletions.
69 changes: 15 additions & 54 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, windows-2022]
os: [macos-11, ubuntu-22.04, windows-2022]

steps:
- if: matrix.os == 'windows-2022'
Expand Down Expand Up @@ -38,23 +38,20 @@ jobs:
cmake --build . --target install
python3 ../scripts/bundle.py mac release done
# - if: matrix.os == 'macos-11'
# name: Build - Debug (MacOS)
# run: |
# rm -r builddir
# rm -r openssl/builddir

# cd openssl
# meson setup builddir --buildtype=debug
# meson compile -C builddir
# cd ..
# mkdir -p builddir
# cd builddir
# cp -r ../openssl/subprojects/openssl-3.0.2/generated-config/archs/darwin64-x86_64-cc/asm/include ../openssl/subprojects/openssl-3.0.2
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF
# cmake --build . --config Debug -- -j8
# cmake --build . --target install
# python3 ../scripts/bundle.py debug done
- if: matrix.os == 'ubuntu-22.04'
name: Build - Release (Linux)
run: |
cd openssl
meson setup builddir --buildtype=release
meson compile -C builddir
cd ..
mkdir -p builddir
cd builddir
cp -r ../openssl/subprojects/openssl-3.0.2/generated-config/archs/linux-x86_64/asm/include ../openssl/subprojects/openssl-3.0.2
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF
cmake --build . --config Release -- -j8
cmake --build . --target install
python3 ../scripts/bundle.py linux release done
- if: matrix.os == 'windows-2022'
name: Build - Release /MT (Windows)
Expand Down Expand Up @@ -89,42 +86,6 @@ jobs:
cmake --build . --target install
python3 ../scripts/bundle.py win release_md done
# - if: matrix.os == 'windows-2022'
# name: Build - Debug /MT (Windows)
# run: |
# rm -r builddir
# rm -r openssl/builddir

# cd openssl
# meson setup builddir --buildtype=debug -Dmt=enabled
# meson compile -C builddir
# cd ..
# mkdir -force builddir
# cd builddir
# cp -r -force ../openssl/subprojects/openssl-3.0.2/generated-config/archs/VC-WIN64A/no-asm/include ../openssl/subprojects/openssl-3.0.2
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF -DPOCO_MT=ON
# cmake --build . --config Debug
# cmake --build . --target install
# python3 ../scripts/bundle.py debug_mt

# - if: matrix.os == 'windows-2022'
# name: Build - Debug /MD (Windows)
# run: |
# rm -r builddir
# rm -r openssl/builddir

# cd openssl
# meson setup builddir --buildtype=debug -Dmt=disabled
# meson compile -C builddir
# cd ..
# mkdir -force builddir
# cd builddir
# cp -r -force ../openssl/subprojects/openssl-3.0.2/generated-config/archs/VC-WIN64A/no-asm/include ../openssl/subprojects/openssl-3.0.2
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=bundle -DENABLE_CRYPTO=ON -DBUILD_SHARED_LIBS=OFF -DPOCO_MT=OFF
# cmake --build . --config Debug
# cmake --build . --target install
# python3 ../scripts/bundle.py debug_md done

- name: Upload
uses: ncipollo/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion openssl/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if host_machine.system() == 'windows'
else
add_global_arguments('/MD', language: 'c')
endif
else
elif host_machine.system() == 'darwin'
add_global_arguments('-mmacosx-version-min=10.15', language: 'c')
endif

Expand Down
5 changes: 1 addition & 4 deletions scripts/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@

# zip

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

if len(sys.argv) > 3:
shutil.make_archive(bundlezip, 'zip', bundledir)
5 changes: 4 additions & 1 deletion scripts/patch/globo
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ component = sys.argv[2]
if platform.system() == 'Windows':
for i in glob.glob('./win/' + config + '/' + component + '/*.obj'):
print(i)
else:
elif platform.system() == 'Darwin':
for i in glob.glob('./mac/' + config + '/' + component + '/*.o'):
print(i)
else:
for i in glob.glob('./linux/' + config + '/' + component + '/*.o'):
print(i)
11 changes: 10 additions & 1 deletion scripts/patch/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if host_machine.system() == 'windows'
compile_args: ['-DPOCO_NO_AUTOMATIC_LIBS', '-DPOCO_STATIC', '/wd4127', '/wd4244', '/wd4245'],
include_directories: 'win/include'
)
else
elif host_machine.system() == 'darwin'
platform = 'mac'
config_mt = 'release'
config_md = 'release'
Expand All @@ -20,6 +20,15 @@ else
compile_args: ['-Wno-deprecated-declarations', '-Wno-sign-compare'],
include_directories: 'mac/include'
)
else
platform = 'linux'
config_mt = 'release'
config_md = 'release'

poco_dep = declare_dependency(
compile_args: ['-Wno-deprecated-declarations', '-Wno-sign-compare'],
include_directories: 'linux/include'
)
endif

cpp = meson.get_compiler('cpp')
Expand Down

0 comments on commit 7d52f66

Please sign in to comment.