commit
78eb383fa1
@ -0,0 +1,49 @@ |
|||||||
|
name: CMake |
||||||
|
|
||||||
|
on: [push, pull_request] |
||||||
|
|
||||||
|
env: |
||||||
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
||||||
|
BUILD_TYPE: Release |
||||||
|
|
||||||
|
jobs: |
||||||
|
build: |
||||||
|
# The CMake configure and build commands are platform agnostic and should work equally |
||||||
|
# well on Windows or Mac. You can convert this to a matrix build if you need |
||||||
|
# cross-platform coverage. |
||||||
|
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix |
||||||
|
runs-on: ${{ matrix.os }} |
||||||
|
strategy: |
||||||
|
matrix: |
||||||
|
os: [ubuntu-20.04, macos-latest, windows-latest] |
||||||
|
|
||||||
|
steps: |
||||||
|
- uses: actions/checkout@v2 |
||||||
|
|
||||||
|
- name: Create Build Environment |
||||||
|
# Some projects don't allow in-source building, so create a separate build directory |
||||||
|
# We'll use this as our working directory for all subsequent commands |
||||||
|
run: cmake -E make_directory ${{runner.workspace}}/build |
||||||
|
|
||||||
|
- name: Configure CMake |
||||||
|
# Use a bash shell so we can use the same syntax for environment variable |
||||||
|
# access regardless of the host operating system |
||||||
|
shell: bash |
||||||
|
working-directory: ${{runner.workspace}}/build |
||||||
|
# Note the current convention is to use the -S and -B options here to specify source |
||||||
|
# and build directories, but this is only available with CMake 3.13 and higher. |
||||||
|
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
||||||
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE |
||||||
|
|
||||||
|
- name: Build |
||||||
|
working-directory: ${{runner.workspace}}/build |
||||||
|
shell: bash |
||||||
|
# Execute the build. You can specify a specific target with "--target <NAME>" |
||||||
|
run: cmake --build . --config $BUILD_TYPE |
||||||
|
|
||||||
|
- name: Test |
||||||
|
working-directory: ${{runner.workspace}}/build |
||||||
|
shell: bash |
||||||
|
# Execute tests defined by the CMake configuration. |
||||||
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
||||||
|
run: ctest -C $BUILD_TYPE |
@ -1,39 +1,20 @@ |
|||||||
language: cpp |
language: cpp |
||||||
sudo: false |
|
||||||
|
|
||||||
matrix: |
matrix: |
||||||
include: |
include: |
||||||
- compiler: gcc |
- os: linux |
||||||
addons: |
addons: |
||||||
apt: |
apt: |
||||||
sources: |
sources: |
||||||
- ubuntu-toolchain-r-test |
- ubuntu-toolchain-r-test |
||||||
- george-edison55-precise-backports |
|
||||||
packages: |
packages: |
||||||
- cmake |
- g++-8 |
||||||
- cmake-data |
env: |
||||||
- gcc-4.9 |
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" |
||||||
- g++-4.9 |
|
||||||
env: COMPILER=g++-4.9 |
|
||||||
# - compiler: clang |
|
||||||
# addons: |
|
||||||
# apt: |
|
||||||
# sources: |
|
||||||
# - kubuntu-backports |
|
||||||
# - ubuntu-toolchain-r-test |
|
||||||
# - llvm-toolchain-precise-3.7 |
|
||||||
# packages: |
|
||||||
# - cmake |
|
||||||
# - clang-3.7 |
|
||||||
# env: COMPILER=clang++-3.7 |
|
||||||
|
|
||||||
branches: |
before_install: |
||||||
only: |
- eval "${MATRIX_EVAL}" |
||||||
- master |
|
||||||
|
|
||||||
before_script: |
|
||||||
- export CXX=$COMPILER |
|
||||||
|
|
||||||
script: |
script: |
||||||
- mkdir build && cd build |
- mkdir build && cd build |
||||||
- cmake .. && make && ctest -V |
- cmake .. && make && ./test/test-main |
||||||
|
@ -1,2 +1,2 @@ |
|||||||
source ~/Projects/emsdk/emsdk_env.sh |
source ~/Projects/emsdk/emsdk_env.sh |
||||||
emcc -std=c++11 -O3 --bind -o native.js native.cpp |
emcc -std=c++17 -O3 --bind -o native.js native.cpp |
||||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,9 +1,9 @@ |
|||||||
cmake_minimum_required(VERSION 2.8) |
cmake_minimum_required(VERSION 3.1) |
||||||
project(peglint) |
project(peglint) |
||||||
|
|
||||||
include_directories(..) |
include_directories(..) |
||||||
add_definitions("-std=c++11") |
|
||||||
add_executable(peglint peglint.cc) |
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
set(CMAKE_CXX_STANDARD 17) |
||||||
target_link_libraries(peglint ${add_link_deps}) |
|
||||||
endif() |
add_executable(peglint peglint.cc) |
||||||
|
target_link_libraries(peglint ${add_link_deps}) |
||||||
|
@ -1,13 +1,14 @@ |
|||||||
cmake_minimum_required(VERSION 3.1) |
cmake_minimum_required(VERSION 3.1) |
||||||
project(test) |
project(test) |
||||||
|
|
||||||
enable_language(CXX) |
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
||||||
set(CMAKE_CXX_STANDARD 11) |
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF) |
|
||||||
|
|
||||||
include_directories(..) |
include_directories(..) |
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17) |
||||||
|
|
||||||
add_executable(test-main test-main.cc test1.cc test2.cc test3.cc) |
add_executable(test-main test-main.cc test1.cc test2.cc test3.cc) |
||||||
target_link_libraries(test-main ${add_link_deps}) |
target_link_libraries(test-main ${add_link_deps}) |
||||||
|
|
||||||
add_test(TestMain test-main) |
add_test( |
||||||
|
NAME TestMain |
||||||
|
COMMAND test-main |
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue