diff --git a/.travis.yml b/.travis.yml index 86b3cc5..8edbf1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,6 @@ compiler: script: - cmake --version - - cmake -H. -Bcmake_build + - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -H. -Bcmake_build - cmake --build cmake_build --target all - CTEST_OUTPUT_ON_FAILURE=1 cmake --build cmake_build --target test diff --git a/CMakeLists.txt b/CMakeLists.txt index 3caa233..0c03b7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,17 @@ cmake_minimum_required(VERSION 3.0) project(CpuFeatures) +# Default Build Type to be Release +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." + FORCE) +endif(NOT CMAKE_BUILD_TYPE) + +# BUILD_TESTING is a standard CMake variable, but we declare it here to make it +# prominent in the GUI. +option(BUILD_TESTING "Enable test (depends on googletest)." OFF) + # # library : cpu_features # @@ -88,6 +99,6 @@ if(BUILD_TESTING) if (CMAKE_VERSION VERSION_LESS 2.8.11) include_directories("${gtest_SOURCE_DIR}/include") endif() - + add_subdirectory(test) endif() diff --git a/appveyor.yml b/appveyor.yml index d2210b9..f18635a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,10 +15,10 @@ matrix: before_build: - cmake --version - - cmake -H. -Bcmake_build -G "%CMAKE_GENERATOR%" + - cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -H. -Bcmake_build -G "%CMAKE_GENERATOR%" build_script: - - cmake --build cmake_build --config Release --target ALL_BUILD + - cmake --build cmake_build --config Debug --target ALL_BUILD test_script: - - cmake --build cmake_build --config Release --target RUN_TESTS + - cmake --build cmake_build --config Debug --target RUN_TESTS