diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bb52340..d47216ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: CI on: push: - branches: [ master ] + branches: [ feature/no-stl-variants-for-github-ci ] pull_request: branches: [ master ] @@ -24,6 +24,24 @@ jobs: - name: Run tests run: ./test/etl_tests +build-gcc-linux-no-stl: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04] + + steps: + - uses: actions/checkout@v2 + + - name: Build and run + run: | + cmake -DBUILD_TESTS=ON -DNO_STL ./ + gcc --version + make + + - name: Run tests + run: ./test/etl_tests + build-clang-9-linux: runs-on: ${{ matrix.os }} strategy: diff --git a/CMakeLists.txt b/CMakeLists.txt index 72627167..347ce61f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,57 +4,14 @@ cmake_minimum_required(VERSION 3.5.0) project(etl) -####################################################################### -# Define an option to allow consumers of the library to -# specify the profile they would like to compile to. If -# not explicitly set CMake will attempt to choose an appropriate -# profile based on the compiler -####################################################################### -set(ETL_PROFILE "DEFAULT" CACHE STRING "Defines what profile header to include. See https://www.etlcpp.com/setup.html" -) - option(BUILD_TESTS "Build unit tests" OFF) +option(NO_STL "No STL" OFF) add_library(etl INTERFACE) -target_include_directories(etl - INTERFACE - include - include/etl/profiles - ) - -if (${ETL_PROFILE} STREQUAL DEFAULT) - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set(ETL_PROFILE "PROFILE_GCC_GENERIC") - - elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(ETL_PROFILE "PROFILE_CLANG_GENERIC") - - elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - set(ETL_PROFILE "PROFILE_MSVC") - - elseif (CMAKE_CXX_COMPILER_ID MATCHES "ARMCC") - if (CXX_STANDARD EQUAL 11) - set(ETL_PROFILE "PROFILE_ARMV6") - else () - set(ETL_PROFILE "PROFILE_ARMV5") - endif() - elseif (CMAKE_CXX_COMPILER_ID MATCHES "TI") - set(ETL_PROFILE "PROFILE_TICC") - - else() - message(FATAL_ERROR "Can't generate default profile for compiler: ${CMAKE_CXX_COMPILER_ID}") - endif() -endif() - -message(STATUS "Compiling with ETL profile set to: ${ETL_PROFILE}") - -target_compile_definitions(etl - INTERFACE - ${ETL_PROFILE} - ) - +target_include_directories(etl INTERFACE include) +target_compile_definitions(etl INTERFACE) if (BUILD_TESTS) enable_testing() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0ba45fad..dded779f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,8 +5,6 @@ add_definitions(-DETL_DEBUG) option(NO_STL "No STL" OFF) -message(STATUS "CMakeLists.txt for ETL unit tests") - if (NO_STL) message(STATUS "Compiling for No STL") add_definitions(-DETL_NO_STL)