Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI #1

Merged
merged 5 commits into from
Jan 26, 2022
Merged

CI #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CMake

on:
push:
pull_request:
branches: [ main ]

env:
BUILD_TYPE: Debug

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ windows-2022, ubuntu-20.04 ]

steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Set up GCC
if: startsWith(matrix.os, 'ubuntu')
uses: egor-tensin/setup-gcc@v1
with:
version: 11

- name: Set up Developer Command Prompt
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1

- name: Enable AddressSanitizer
if: startsWith(matrix.os, 'ubuntu')
run: |
echo "CXXFLAGS=-fsanitize=address" >> $GITHUB_ENV
echo "LDFLAGS=-fsanitize=address" >> $GITHUB_ENV

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: ninja -C ${{github.workspace}}/build

- name: Test
working-directory: ${{github.workspace}}/build
run: ./hana-test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
build*/
build*/

# Visual Studio 2015/2017 cache/options directory
.vs/
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ cmake_policy(SET CMP0092 NEW) # default warning /W3 is disabled as we are using

project(hana23 VERSION 0.1 LANGUAGES CXX)

include(CTest)

add_subdirectory(include)

add_executable(hana-test EXCLUDE_FROM_ALL test.cpp)
target_link_libraries(hana-test PRIVATE hana23)
if(BUILD_TESTING)
add_executable(hana-test test.cpp)
target_link_libraries(hana-test PRIVATE hana23)
endif()
30 changes: 30 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "WSL-GCC-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeExecutable": "cmake",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"wslPath": "Ubuntu-20.04",
"addressSanitizerEnabled": true,
"variables": []
}
]
}
2 changes: 1 addition & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_library(hana23 INTERFACE)

target_sources(hana23 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/hana23/move_only_function.hpp)
target_sources(hana23 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/hana23/move_only_function.hpp)

target_compile_features(hana23 INTERFACE cxx_std_20)
target_include_directories(hana23 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
1 change: 1 addition & 0 deletions include/hana23/move_only_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define HANA23_MOVE_ONLY_FUNCTION_HPP

#include "utility/move_only_function.hpp"
#include <functional>
#include <iostream>
#include <memory>
#include <type_traits>
Expand Down
1 change: 1 addition & 0 deletions include/hana23/move_only_function.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define HANA23_MOVE_ONLY_FUNCTION_HPP

#include "utility/move_only_function.hpp"
#include <functional>
#include <iostream>
#include <memory>
#include <type_traits>
Expand Down
2 changes: 2 additions & 0 deletions include/hana23/utility/move_only_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace hana23 {

using std::size_t;

// is in_place

constexpr inline size_t _move_only_function_buffer_size = sizeof(void *);
Expand Down