Skip to content

Commit f07caad

Browse files
authored
Merge pull request #440 from pmienk/install-cmake-v3
Add cmake builds to CI.
2 parents e7416c2 + 8a0ed49 commit f07caad

4 files changed

Lines changed: 1456 additions & 128 deletions

File tree

.github/workflows/ci.yml

Lines changed: 242 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: Continuous Integration Build
1010
on: [ pull_request, push, workflow_dispatch ]
1111

1212
jobs:
13-
verify-installsh:
13+
autotools:
1414

1515
strategy:
1616
fail-fast: false
@@ -20,6 +20,7 @@ jobs:
2020
- os: ubuntu-latest
2121
cxx: "clang++"
2222
link: "dynamic"
23+
optimization: "size"
2324
assert: "debug"
2425
coverage: "nocov"
2526
boost: "--build-boost"
@@ -28,11 +29,12 @@ jobs:
2829
cc: "clang"
2930
flags: "-Os -fPIE"
3031
packager: "apt"
31-
packages: "clang"
32+
packages: ""
3233

3334
- os: ubuntu-latest
3435
cxx: "clang++"
3536
link: "static"
37+
optimization: "size"
3638
assert: "ndebug"
3739
coverage: "nocov"
3840
boost: "--build-boost"
@@ -41,11 +43,12 @@ jobs:
4143
cc: "clang"
4244
flags: "-Os -fPIE"
4345
packager: "apt"
44-
packages: "clang"
46+
packages: ""
4547

4648
- os: ubuntu-latest
4749
cxx: "g++"
4850
link: "dynamic"
51+
optimization: "size"
4952
assert: "ndebug"
5053
coverage: "nocov"
5154
boost: "--build-boost"
@@ -54,11 +57,12 @@ jobs:
5457
cc: "gcc"
5558
flags: "-Os -fPIE"
5659
packager: "apt"
57-
packages: "gcc"
60+
packages: ""
5861

5962
- os: ubuntu-latest
6063
cxx: "g++"
6164
link: "static"
65+
optimization: "debug"
6266
assert: "ndebug"
6367
coverage: "cov"
6468
boost: "--build-boost"
@@ -67,11 +71,12 @@ jobs:
6771
cc: "gcc"
6872
flags: "-Og -g --coverage -fPIE"
6973
packager: "apt"
70-
packages: "gcc lcov"
74+
packages: "lcov"
7175

7276
- os: macos-latest
7377
cxx: "clang++"
7478
link: "dynamic"
79+
optimization: "size"
7580
assert: "ndebug"
7681
coverage: "nocov"
7782
boost: "--build-boost"
@@ -85,6 +90,7 @@ jobs:
8590
- os: macos-latest
8691
cxx: "clang++"
8792
link: "static"
93+
optimization: "size"
8894
assert: "ndebug"
8995
coverage: "nocov"
9096
boost: "--build-boost"
@@ -95,6 +101,7 @@ jobs:
95101
packager: "brew"
96102
packages: ""
97103

104+
98105
runs-on: ${{ matrix.os }}
99106

100107
env:
@@ -160,6 +167,11 @@ jobs:
160167
path-to-lcov: "./coverage.info"
161168
github-token: ${{ secrets.github_token }}
162169

170+
- name: Failure display available binaries
171+
if: ${{ failure() }}
172+
run: |
173+
ls -la /usr/bin
174+
163175
- name: Failure display selected compiler version
164176
if: ${{ failure() }}
165177
run: |
@@ -197,7 +209,231 @@ jobs:
197209
run: |
198210
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-node-test
199211
200-
verify-sln:
212+
- name: Failure display pkgconfig
213+
if: ${{ failure() }}
214+
run: |
215+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
216+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
217+
218+
cmake:
219+
220+
strategy:
221+
fail-fast: false
222+
223+
matrix:
224+
include:
225+
- os: ubuntu-latest
226+
cxx: "clang++"
227+
link: "dynamic"
228+
optimization: "size"
229+
assert: "debug"
230+
coverage: "nocov"
231+
boost: "--build-boost"
232+
consensus: ""
233+
icu: ""
234+
cc: "clang"
235+
flags: "-Os -fPIE"
236+
packager: "apt"
237+
packages: ""
238+
239+
- os: ubuntu-latest
240+
cxx: "clang++"
241+
link: "static"
242+
optimization: "size"
243+
assert: "ndebug"
244+
coverage: "nocov"
245+
boost: "--build-boost"
246+
consensus: ""
247+
icu: "--build-icu --with-icu"
248+
cc: "clang"
249+
flags: "-Os -fPIE"
250+
packager: "apt"
251+
packages: ""
252+
253+
- os: ubuntu-latest
254+
cxx: "g++"
255+
link: "dynamic"
256+
optimization: "size"
257+
assert: "ndebug"
258+
coverage: "nocov"
259+
boost: "--build-boost"
260+
consensus: "-Dwith-consensus=no"
261+
icu: ""
262+
cc: "gcc"
263+
flags: "-Os -fPIE"
264+
packager: "apt"
265+
packages: ""
266+
267+
- os: ubuntu-latest
268+
cxx: "g++"
269+
link: "static"
270+
optimization: "debug"
271+
assert: "ndebug"
272+
coverage: "nocov"
273+
boost: "--build-boost"
274+
consensus: ""
275+
icu: "--build-icu --with-icu"
276+
cc: "gcc"
277+
flags: "-Og -fPIE"
278+
packager: "apt"
279+
packages: ""
280+
281+
- os: macos-latest
282+
cxx: "clang++"
283+
link: "dynamic"
284+
optimization: "size"
285+
assert: "ndebug"
286+
coverage: "nocov"
287+
boost: "--build-boost"
288+
consensus: ""
289+
icu: "--build-icu --with-icu"
290+
cc: "clang"
291+
flags: "-Os -fPIE"
292+
packager: "brew"
293+
packages: ""
294+
295+
- os: macos-latest
296+
cxx: "clang++"
297+
link: "static"
298+
optimization: "size"
299+
assert: "ndebug"
300+
coverage: "nocov"
301+
boost: "--build-boost"
302+
consensus: "-Dwith-consensus=no"
303+
icu: "--build-icu --with-icu"
304+
cc: "clang"
305+
flags: "-Os -fvisibility=hidden -fPIE"
306+
packager: "brew"
307+
packages: ""
308+
309+
310+
runs-on: ${{ matrix.os }}
311+
312+
env:
313+
CC: '${{ matrix.cc }}'
314+
CXX: '${{ matrix.cxx }}'
315+
CFLAGS: '${{ matrix.flags }}'
316+
CXXFLAGS: '${{ matrix.flags }}'
317+
CI_REPOSITORY: '${{ github.repository }}'
318+
319+
steps:
320+
- name: Checkout repository
321+
uses: actions/checkout@v2
322+
323+
- name: Prepare toolchain [apt]
324+
if: ${{ matrix.packager == 'apt' }}
325+
run: |
326+
sudo apt-get update
327+
sudo apt-get install git build-essential autoconf automake libtool pkg-config ${{ matrix.packages }}
328+
329+
- name: Prepare toolchain [brew]
330+
if: ${{ matrix.packager == 'brew' }}
331+
run: |
332+
brew install autoconf automake libtool pkg-config ${{ matrix.packages }}
333+
334+
- name: Denormalize parameterization
335+
run: |
336+
if [[ ${{ matrix.packager }} == 'brew' ]]; then
337+
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
338+
fi
339+
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
340+
echo "ASSERT_NDEBUG=--enable-ndebug -Denable-ndebug=yes" >> $GITHUB_ENV
341+
else
342+
echo "ASSERT_NDEBUG=--disable-ndebug -Denable-ndebug=no" >> $GITHUB_ENV
343+
fi
344+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
345+
echo "LINKAGE=--disable-static" >> $GITHUB_ENV
346+
else
347+
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
348+
fi
349+
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
350+
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefixenv/lib" >> $GITHUB_ENV
351+
fi
352+
353+
- name: Execute install-cmake.sh
354+
run: >
355+
./install-cmake.sh
356+
--build-dir=${{ github.workspace }}/build
357+
--prefix=${{ github.workspace }}/prefixenv
358+
${{ env.LINKAGE }}
359+
${{ env.ASSERT_NDEBUG }}
360+
${{ matrix.boost }}
361+
${{ matrix.icu }}
362+
${{ matrix.consensus }}
363+
364+
- name: Coveralls Calculation
365+
if: ${{ matrix.coverage == 'cov' }}
366+
run: |
367+
lcov --directory . --capture --output-file coverage.info
368+
lcov --remove coverage.info "/usr/*" "${{ github.workspace }}/prefixenv/*" "${{ github.workspace }}/build/*" "${{ github.workspace }}/examples/*" "${{ github.workspace }}/test/*" --output-file coverage.info
369+
lcov --list coverage.info
370+
371+
- name: Coveralls.io Upload
372+
if: ${{ matrix.coverage == 'cov' }}
373+
uses: coverallsapp/github-action@master
374+
with:
375+
path-to-lcov: "./coverage.info"
376+
github-token: ${{ secrets.github_token }}
377+
378+
- name: Failure display available binaries
379+
if: ${{ failure() }}
380+
run: |
381+
ls -la /usr/bin
382+
383+
- name: Failure display selected compiler version
384+
if: ${{ failure() }}
385+
run: |
386+
${CC} -v
387+
${CXX} -v
388+
389+
- name: Failure display default compiler version
390+
if: ${{ failure() }}
391+
run: |
392+
clang -v
393+
gcc -v
394+
395+
- name: Failure display env
396+
if: ${{ failure() }}
397+
run: |
398+
env
399+
400+
- name: Failure list libdir
401+
if: ${{ failure() }}
402+
run: |
403+
ls -la ${{ github.workspace }}/prefixenv/lib
404+
405+
- name: Failure display boost bootstrap.log [--build-boost]
406+
if: ${{ failure() && (matrix.boost == '--build-boost') }}
407+
run: |
408+
cat ${{ github.workspace }}/build/build-*/bootstrap.log
409+
410+
- name: Failure display otool output
411+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
412+
run: |
413+
otool -L ${{ github.workspace }}/test/.libs/libbitcoin-node-test
414+
415+
- name: Failure display DYLD_PRINT_LIBRARIES
416+
if: ${{ failure() && (matrix.os == 'macos-latest') }}
417+
run: |
418+
DYLD_PRINT_LIBRARIES=1 ${{ github.workspace }}/test/.libs/libbitcoin-node-test
419+
420+
- name: Failure display pkgconfig
421+
if: ${{ failure() }}
422+
run: |
423+
ls ${{ github.workspace }}/prefixenv/lib/pkgconfig/
424+
cat ${{ github.workspace }}/prefixenv/lib/pkgconfig/*.pc
425+
426+
- name: Failure display cmake specific libraries
427+
if: ${{ failure() }}
428+
run: |
429+
ls ${{ github.workspace }}/prefixenv/lib/cmake
430+
431+
- name: Failure display cmake LastTest.log
432+
if: ${{ failure() }}
433+
run: |
434+
cat ${{ github.workspace }}/Testing/Temporary/LastTest.log
435+
436+
msbuild:
201437
strategy:
202438
fail-fast: false
203439

builds/cmake/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ else ()
3030
set( libdir "\${exec_prefix}/lib" )
3131
set( includedir "\${exec_prefix}/include" )
3232

33-
set( PACKAGE_VERSION "4.0.0" )
33+
set( PACKAGE_VERSION "3.7.0" )
3434
set( VERSION "${PACKAGE_VERSION}" )
3535
endif ()
3636

@@ -60,6 +60,9 @@ add_compile_options( "-Wno-missing-braces" )
6060
# Ignore comments within comments or commenting of backslash extended lines.
6161
add_compile_options( "-Wno-comment" )
6262

63+
# Suppress warning for copy of implicitly generated copy constructor.
64+
add_compile_options( "-Wno-deprecated-copy" )
65+
6366
# Conflict in stdlib under clang.
6467
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
6568
add_compile_options( "-Wno-mismatched-tags" )
@@ -95,6 +98,12 @@ if (BUILD_SHARED_LIBS)
9598
add_definitions( -DBOOST_ALL_DYN_LINK )
9699
endif()
97100

101+
if (BUILD_SHARED_LIBS)
102+
set( Boost_USE_STATIC_LIBS "off" )
103+
else()
104+
set( Boost_USE_STATIC_LIBS "on" )
105+
endif()
106+
98107
# Find boost
99108
#------------------------------------------------------------------------------
100109
find_package( Boost 1.72.0 REQUIRED COMPONENTS
@@ -119,11 +128,11 @@ endif()
119128

120129
# Find bitcoin-blockchain
121130
#------------------------------------------------------------------------------
122-
find_package( Bitcoin-Blockchain 4.0.0 REQUIRED )
131+
find_package( Bitcoin-Blockchain 3.7.0 REQUIRED )
123132

124133
# Find bitcoin-network
125134
#------------------------------------------------------------------------------
126-
find_package( Bitcoin-Network 4.0.0 REQUIRED )
135+
find_package( Bitcoin-Network 3.7.0 REQUIRED )
127136

128137
# Define project common includes directories
129138
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)