From 08cb7dd21c993c75a68470167ce90535faf43fc7 Mon Sep 17 00:00:00 2001 From: bialger Date: Tue, 13 Aug 2024 11:24:10 +0300 Subject: [PATCH] Removed MinGW test run, properly formatted CMake files --- .github/workflows/ci_tests.yml | 12 +++--------- CMakeLists.txt | 6 +++--- bin/CMakeLists.txt | 4 ++-- lib/CMakeLists.txt | 4 ++-- tests/CMakeLists.txt | 4 ++-- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 3314599..2fa364b 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -61,12 +61,7 @@ jobs: working-directory: ./cmake-build-release run: | if [ "$RUNNER_OS" == "Windows" ]; then - if [ "${{ matrix.config.cxx }}" == "g++" ]; then - cd bin - ./cpp_tests.exe --help - else - ./cpp_tests.exe --help - fi + ./cpp_tests.exe --help else cd bin ./cpp_tests --help @@ -78,9 +73,8 @@ jobs: run: | if [ "$RUNNER_OS" == "Windows" ]; then if [ "${{ matrix.config.cxx }}" == "g++" ]; then - # echo "Currently unable to run tests on ${{ matrix.config.name }}. See https://gitmemories.com/cristianadam/HelloWorld/issues/12 and https://github.com/microsoft/vscode-cmake-tools/issues/2451" - cd tests - ./cpp_tests_tests.exe + echo "Currently unable to run tests on ${{ matrix.config.name }}. See https://gitmemories.com/cristianadam/HelloWorld/issues/12 and https://github.com/microsoft/vscode-cmake-tools/issues/2451" + # ./cpp_tests_tests.exe else ./cpp_tests_tests.exe fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 51d7c2c..c03953b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,14 +9,14 @@ project( set(CMAKE_CXX_STANDARD 20) -if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Install dlls in the same directory as the executable on Windows MSVC +if (WIN32) # Install dlls in the same directory as the executable on Windows set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) -endif() +endif () if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS_DEBUG "/MDd") @@ -24,7 +24,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") else () set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") -endif() +endif () add_subdirectory(lib) add_subdirectory(bin) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 1beeaeb..c84570b 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,8 +1,8 @@ add_executable(${PROJECT_NAME} main.cpp) -if(NOT CMAKE_BUILD_TYPE) +if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) # Main executable should be built with Release -endif() +endif () message(STATUS "Main executable build type: ${CMAKE_BUILD_TYPE}") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8d0970f..4da245d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.12) -if(NOT CMAKE_BUILD_TYPE) +if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) # Change this to Release when you're ready to release -endif() +endif () message(STATUS "Libraries build type: ${CMAKE_BUILD_TYPE}") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 40ba960..20d4b8f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -29,9 +29,9 @@ target_link_libraries( GTest::gtest_main ) -if(NOT CMAKE_BUILD_TYPE) +if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) # Tests should be built with Debug -endif() +endif () message(STATUS "Tests build type: ${CMAKE_BUILD_TYPE}")