Skip to content

Commit

Permalink
use conan2, fix plt bug and warning fix, test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf committed Oct 23, 2024
1 parent 4bba213 commit e51d256
Show file tree
Hide file tree
Showing 12 changed files with 740 additions and 35 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
Expand All @@ -18,19 +18,20 @@ jobs:
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.59.0
version: 2.8.1

- name: Configure conan
run: |
conan profile new default --detect
conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile detect
sed -i 's/compiler\.cppstd=.*/compiler.cppstd=20/g' ~/.conan2/profiles/default
conan install --build=fmt/11.0.0 .
- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel $(nproc)
cmake -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../conan_provider.cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -DCMAKE_BUILD_TYPE=Release ..
cmake --build --config Release --parallel $(nproc) .
- name: Unit test
run: |
Expand Down
22 changes: 0 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,6 @@ check_ipo_supported()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE)

if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.16.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
TLS_VERIFY ON)
endif ()

include(${CMAKE_BINARY_DIR}/conan.cmake)

conan_check(VERSION 1.43.1 REQUIRED)

conan_cmake_run(
REQUIRES
catch2/2.13.7
approvaltests.cpp/10.12.0
fmt/9.1.0
ctre/3.7.1
BASIC_SETUP
BUILD missing)

include(${CMAKE_BINARY_DIR}/conan.cmake)

enable_testing()

add_subdirectory(src)
15 changes: 15 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

PATH=/opt/compiler-explorer/cmake/bin:/opt/compiler-explorer/ninja:$PWD/.venv/bin:$PATH

rm -Rf build
mkdir build
cmake -B build -G Ninja -S . -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./conan_provider.cmake -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug

CURDIR=$PWD

cd build/src
test/asm-parser-test

cd $PWD
Loading

0 comments on commit e51d256

Please sign in to comment.