@@ -104,9 +104,9 @@ jobs:
104104 cd fmt
105105 cmake -S . -B ./build -D FMT_DOC=OFF -D FMT_TEST=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_CXX_COMPILER=${{ steps.setup-cpp.outputs.cxx }} -DCMAKE_C_COMPILER=${{ steps.setup-cpp.outputs.cc }}
106106 N_CORES=$(nproc 2>/dev/null || echo 1)
107- cmake --build ./build --config ${{ matrix.build-type }} --parallel $N_CORES
107+ cmake --build ./build --config ${{ matrix.build-type }} --parallel $N_CORES
108108 cmake --install ./build --prefix ./install
109-
109+
110110 fmt_root=$(pwd)/install
111111 if [[ ${{ runner.os }} == 'Windows' ]]; then
112112 fmt_root=$(echo "$fmt_root" | sed 's/\\/\//g')
@@ -135,9 +135,9 @@ jobs:
135135 fi
136136 cmake -S . -B ./build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_CXX_COMPILER=${{ steps.setup-cpp.outputs.cxx }} -DCMAKE_C_COMPILER=${{ steps.setup-cpp.outputs.cc }}
137137 N_CORES=$(nproc 2>/dev/null || echo 1)
138- cmake --build ./build --config ${{ matrix.build-type }} --parallel $N_CORES
138+ cmake --build ./build --config ${{ matrix.build-type }} --parallel $N_CORES
139139 cmake --install ./build --prefix ./install
140-
140+
141141 duktape_root=$(pwd)/install
142142 if [[ ${{ runner.os }} == 'Windows' ]]; then
143143 duktape_root=$(echo "$duktape_root" | sed 's/\\/\//g')
@@ -159,12 +159,12 @@ jobs:
159159 git config --global advice.detachedHead false
160160 git clone https://github.com/GNOME/libxml2 --branch v2.12.6 --depth 1
161161 cd libxml2
162-
162+
163163 cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DLIBXML2_WITH_PROGRAMS=ON -DLIBXML2_WITH_FTP=OFF -DLIBXML2_WITH_HTTP=OFF -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LEGACY=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_ZLIB=OFF -DLIBXML2_WITH_ICU=OFF -DLIBXML2_WITH_TESTS=OFF -DLIBXML2_WITH_HTML=ON -DLIBXML2_WITH_C14N=ON -DLIBXML2_WITH_CATALOG=ON -DLIBXML2_WITH_DEBUG=ON -DLIBXML2_WITH_ISO8859X=ON -DLIBXML2_WITH_MEM_DEBUG=OFF -DLIBXML2_WITH_MODULES=ON -DLIBXML2_WITH_OUTPUT=ON -DLIBXML2_WITH_PATTERN=ON -DLIBXML2_WITH_PUSH=ON -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_READER=ON -DLIBXML2_WITH_REGEXPS=ON -DLIBXML2_WITH_SAX1=ON -DLIBXML2_WITH_SCHEMAS=ON -DLIBXML2_WITH_SCHEMATRON=ON -DLIBXML2_WITH_THREADS=ON -DLIBXML2_WITH_THREAD_ALLOC=OFF -DLIBXML2_WITH_TREE=ON -DLIBXML2_WITH_VALID=ON -DLIBXML2_WITH_WRITER=ON -DLIBXML2_WITH_XINCLUDE=ON -DLIBXML2_WITH_XPATH=ON -DLIBXML2_WITH_XPTR=ON -DCMAKE_CXX_COMPILER=${{ steps.setup-cpp.outputs.cxx || steps.parameters.outputs.clang-bin }} -DCMAKE_C_COMPILER=${{ steps.setup-cpp.outputs.cc || steps.parameters.outputs.clang-bin }}
164164 N_CORES=$(nproc 2>/dev/null || echo 1)
165- cmake --build ./build --config ${{ matrix.build-type }} --parallel $N_CORES
165+ cmake --build ./build --config ${{ matrix.build-type }} --parallel $N_CORES
166166 cmake --install ./build --prefix ./install
167-
167+
168168 libxml2_root=$(pwd)/install
169169 if [[ ${{ runner.os }} == 'Windows' ]]; then
170170 libxml2_root=$(echo "$libxml2_root" | sed 's/\\/\//g')
@@ -193,7 +193,7 @@ jobs:
193193 uses : actions/cache@v4
194194 with :
195195 path : ${{ steps.llvm-parameters.outputs.llvm-root }}
196- key : llvm-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.version }}-${{ steps.llvm-parameters.outputs.llvm-build-preset }}-${{ steps.llvm-parameters.outputs.llvm-hash }}
196+ key : llvm-libcxx- ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.version }}-${{ steps.llvm-parameters.outputs.llvm-build-preset }}-${{ steps.llvm-parameters.outputs.llvm-hash }}
197197
198198 - name : Install LLVM
199199 id : llvm-install
@@ -202,7 +202,7 @@ jobs:
202202 run : |
203203 # LLVM is be installed with the default compiler
204204 set -x
205-
205+
206206 # Shallow clone LLVM_HASH in ../third-party/llvm
207207 cd ..
208208 mkdir -p third-party/llvm-project
@@ -218,19 +218,56 @@ jobs:
218218 # Copy presets
219219 cp ../../mrdocs/third-party/llvm/CMakePresets.json ./llvm
220220 cp ../../mrdocs/third-party/llvm/CMakeUserPresets.json.example ./llvm/CMakeUserPresets.json
221-
221+
222222 # Build
223223 cd llvm
224224 llvm_root=$(pwd)
225225 cmake --version
226226 cmake -S . -B ./build --preset=${{ steps.llvm-parameters.outputs.llvm-build-preset }} -DCMAKE_CXX_COMPILER=${{ steps.setup-cpp.outputs.cxx }} -DCMAKE_C_COMPILER=${{ steps.setup-cpp.outputs.cc }}
227227 if [[ ${{ runner.os }} == 'Linux' ]]; then
228228 cmake --build ./build --target help
229- fi
229+ fi
230230 N_CORES=$(nproc 2>/dev/null || echo 1)
231231 cmake --build ./build --config Release --parallel $N_CORES
232232 cmake --install ./build --prefix "$llvm_project_root"/install
233233
234+ - name : Install LibC++
235+ id : libcxx-install
236+ if : steps.llvm-cache.outputs.cache-hit != 'true'
237+ shell : bash
238+ run : |
239+ set -x
240+ cd ../third-party/llvm-project
241+ llvm_project_root=$(pwd)
242+
243+ export CXX="$llvm_project_root/install/bin/clang++"
244+ export CC="$llvm_project_root/install/bin/clang"
245+
246+ if [[ ${{ runner.os }} != 'Windows' ]]; then
247+ cmake -G Ninja \
248+ -S runtimes \
249+ -B build-libcxx \
250+ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
251+ -DCMAKE_INSTALL_PREFIX="$llvm_project_root/install"
252+
253+ ninja -C build-libcxx cxx cxxabi unwind
254+ ninja -C build-libcxx install-cxx install-cxxabi install-unwind
255+ else
256+ cmake -G Ninja \
257+ -S runtimes \
258+ -B build-libcxx \
259+ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
260+ -DCMAKE_INSTALL_PREFIX="$llvm_project_root/install" \
261+ -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
262+ -DLIBCXXABI_ENABLE_SHARED=OFF \
263+ -DLIBCXXABI_ENABLE_STATIC=ON \
264+ -DLIBCXX_ENABLE_SHARED=OFF \
265+ -DLIBCXX_NO_VCRUNTIME=ON \
266+ -DCMAKE_CXX_FLAGS="-D__ORDER_LITTLE_ENDIAN__=1234 -D__ORDER_BIG_ENDIAN__=4321 -D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__"
267+ ninja -C build-libcxx cxx
268+ ninja -C build-libcxx install-cxx
269+ fi
270+
234271 - name : Install Node.js
235272 uses : actions/setup-node@v3
236273 with :
@@ -256,7 +293,7 @@ jobs:
256293 -D duktape_ROOT=${{ steps.duktape-install.outputs.duktape-root }}
257294 -D Duktape_ROOT=${{ steps.duktape-install.outputs.duktape-root }}
258295 -D fmt_ROOT=${{ steps.fmt-install.outputs.fmt-root }}
259- ${{ (steps.libxml2-install.outputs.libxml2-root && format('-D libxml2_ROOT={0}', steps.libxml2-install.outputs.libxml2-root)) || '' }}
296+ ${{ (steps.libxml2-install.outputs.libxml2-root && format('-D libxml2_ROOT={0}', steps.libxml2-install.outputs.libxml2-root)) || '' }}
260297 ${{ (steps.libxml2-install.outputs.libxml2-root && format('-D LibXml2_ROOT={0}', steps.libxml2-install.outputs.libxml2-root)) || '' }}
261298 export-compile-commands : true
262299 run-tests : true
@@ -296,27 +333,17 @@ jobs:
296333 run :
297334 shell : bash
298335 name : Releases
299- timeout-minutes : 30
300- runs-on : ubuntu-20.04
301- container : ubuntu:23 .04
336+ timeout-minutes : 30
337+ runs-on : ubuntu-latest
338+ container : ubuntu:20 .04
302339 permissions :
303340 contents : write
304341 steps :
305- - name : Setup C++
306- uses :
alandefreitas/cpp-actions/[email protected] 307- id : setup-cpp
308- with :
309- compiler : clang
310- version : 16
311- check-latest : true
312-
313342 - name : Install packages
314343 uses :
alandefreitas/cpp-actions/[email protected] 315344 id : package-install
316345 with :
317- apt-get : libstdc++-12-dev asciidoctor cmake bzip2 git
318- cc : ${{ steps.setup-cpp.outputs.cc }}
319- cxx : ${{ steps.setup-cpp.outputs.cxx }}
346+ apt-get : build-essential asciidoctor cmake bzip2 git
320347
321348 - name : Clone mrdocs
322349 uses : actions/checkout@v4
@@ -344,8 +371,6 @@ jobs:
344371 mrdocs --version
345372 MRDOCS_ROOT=/usr/local
346373 echo -e "MRDOCS_ROOT=$MRDOCS_ROOT" >> $GITHUB_ENV
347- CXX=/usr/bin/clang-16
348- echo -e "CXX=$CXX" >> $GITHUB_ENV
349374
350375 - name : Clone Boost.URL
351376 uses :
alandefreitas/cpp-actions/[email protected] @@ -398,11 +423,6 @@ jobs:
398423
399424 - name : Generate Demos
400425 run : |
401- CXX="${{ steps.setup-cpp.outputs.cxx }}"
402- export CXX
403- CC="${{ steps.setup-cpp.outputs.cc }}"
404- export CC
405-
406426 declare -a generators=(
407427 "adoc"
408428 "xml"
@@ -443,15 +463,15 @@ jobs:
443463 id : compare-demos
444464 run : |
445465 set -x
446-
466+
447467 # Define URLs and directories
448468 LOCAL_DEMOS_DIR="./demos/"
449469 PREV_DEMOS_DIR="./demos-previous/"
450470 DIFF_DIR="./demos-diff/"
451-
471+
452472 # Create directories if they don't exist
453473 mkdir -p $PREV_DEMOS_DIR $DIFF_DIR
454-
474+
455475 # Iterate over the previous files and compare them with the corresponding local files
456476 find $PREV_DEMOS_DIR -type f | while read previous_file; do
457477 # Derive the corresponding local file path
@@ -469,7 +489,7 @@ jobs:
469489 cat "$previous_file" >> "$diff_output"
470490 fi
471491 done
472-
492+
473493 # Iterate over the local files to find new files
474494 find $LOCAL_DEMOS_DIR -type f | while read local_file; do
475495 previous_file="${PREV_DEMOS_DIR}${local_file#$LOCAL_DEMOS_DIR}"
@@ -480,7 +500,7 @@ jobs:
480500 echo "NEW CONTENT OF THE FILE IS:" >> "$diff_output"
481501 fi
482502 done
483-
503+
484504 # Check if the diff directory is empty
485505 if [[ -z $(ls -A $DIFF_DIR) ]]; then
486506 echo "No differences found."
0 commit comments