mirror of
https://github.com/gwm17/implot.git
synced 2024-11-26 12:18:52 -05:00
CI setup (#395)
* Fix truncation warnings. * CI: GitHub Actions CI setup.
This commit is contained in:
parent
002ffc95bc
commit
fd16fe001c
25
.github/CMakeLists.txt
vendored
Normal file
25
.github/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
# This build script is not meant for general use, it is for CI use only!
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(implot)
|
||||
|
||||
# Same as Dear ImGui
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
file(GLOB SOURCE_CODE ../implot*.*)
|
||||
add_library(implot STATIC ${SOURCE_CODE})
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(implot PRIVATE /W4 /WX)
|
||||
else()
|
||||
target_compile_options(implot PRIVATE -Wall -Werror -pedantic)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" AND DEFINED GCC_ARCH)
|
||||
if ("${GCC_ARCH}" MATCHES "Win32|x86|32")
|
||||
target_compile_options(implot PRIVATE -m32)
|
||||
elseif ("${GCC_ARCH}" MATCHES "Win64|x64|64")
|
||||
target_compile_options(implot PRIVATE -m64)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
target_include_directories(implot PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../imgui)
|
113
.github/workflows/build.yml
vendored
Normal file
113
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
Linux:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type:
|
||||
- debug
|
||||
- release
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
arch:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ocornut/imgui
|
||||
path: imgui
|
||||
|
||||
- name: Dependencies
|
||||
run: sudo apt-get install g++-multilib
|
||||
|
||||
- name: Configure
|
||||
run: cmake -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_C_COMPILER=${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DGCC_ARCH=${{ matrix.arch }} -B cmake-build -S .github
|
||||
|
||||
- name: Build
|
||||
run: cmake --build cmake-build --parallel $(nproc)
|
||||
|
||||
|
||||
MacOS:
|
||||
runs-on: macos-11
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type:
|
||||
- debug
|
||||
- release
|
||||
arch:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ocornut/imgui
|
||||
path: imgui
|
||||
|
||||
- name: Configure
|
||||
shell: bash
|
||||
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DGCC_ARCH=${{ matrix.arch }} -B cmake-build -S .github
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: cmake --build cmake-build --parallel $(sysctl -n hw.ncpu)
|
||||
|
||||
Windows:
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type:
|
||||
- debug
|
||||
- release
|
||||
arch:
|
||||
- Win32
|
||||
- x64
|
||||
compiler:
|
||||
- msvc
|
||||
- mingw
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ocornut/imgui
|
||||
path: imgui
|
||||
|
||||
- name: Configure (MSVC)
|
||||
if: matrix.compiler == 'msvc'
|
||||
shell: bash
|
||||
run: cmake -G 'Visual Studio 17 2022' -A ${{ matrix.arch }} -B cmake-build -S .github
|
||||
|
||||
- name: Build (MSVC)
|
||||
if: matrix.compiler == 'msvc'
|
||||
shell: bash
|
||||
run: cmake --build cmake-build -- -p:Configuration=${{ matrix.build_type }} -maxcpucount:$NUMBER_OF_PROCESSORS
|
||||
|
||||
- name: Configure (MingW)
|
||||
if: matrix.compiler == 'mingw'
|
||||
shell: bash
|
||||
run: cmake -G 'MinGW Makefiles' -DGCC_ARCH=${{ matrix.arch }} -B cmake-build -S .github
|
||||
|
||||
- name: Build (MingW)
|
||||
if: matrix.compiler == 'mingw'
|
||||
shell: bash
|
||||
run: cmake --build cmake-build --parallel $NUMBER_OF_PROCESSORS
|
Loading…
Reference in New Issue
Block a user