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

Add debug builds to CI #36

Merged
merged 6 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release]
build_type: [Release, Debug]

steps:
- uses: actions/checkout@v4
Expand Down
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ set(variant "" CACHE STRING "build variant")
# command line options
option(release "build release version (no debug output)" OFF)

if(NOT release)
# build debug
set(CMAKE_BUILD_TYPE Debug)
# Existing CMAKE_BUILD_TYPE takes priority if directly defined
if(NOT CMAKE_BUILD_TYPE)
damianhxy marked this conversation as resolved.
Show resolved Hide resolved
if(release)
set(CMAKE_BUILD_TYPE Release)
else()
set(CMAKE_BUILD_TYPE Debug)
endif()
endif()

if(CMAKE_BUILD_TYPE MATCHES Debug)
set(PRINT_DEBUG TRUE)
else(NOT release)
# build release
set(CMAKE_BUILD_TYPE Release)
else()
set(PRINT_DEBUG FALSE)
endif(NOT release)
endif()

message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Build variant: ${variant}")
Expand Down