Skip to content

Commit

Permalink
Removed MinGW test run, properly formatted CMake files
Browse files Browse the repository at this point in the history
  • Loading branch information
bialger committed Aug 13, 2024
1 parent 01ad5cd commit 08cb7dd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ 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")
set(CMAKE_CXX_FLAGS_RELEASE "/O2")
else ()
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif()
endif ()

add_subdirectory(lib)
add_subdirectory(bin)
Expand Down
4 changes: 2 additions & 2 deletions bin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}")

Expand Down
4 changes: 2 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}")

Expand Down
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down

0 comments on commit 08cb7dd

Please sign in to comment.