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

bugfix: fix compilation with logger turned off #270

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Changes from 2 commits
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
8 changes: 8 additions & 0 deletions cmake/Modules/Logger.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ if(${index} GREATER -1)
else()
cmessage(FATAL_ERROR "Invalid log level specified: ${LOG_LEVEL} \n Should be one of: ${VALID_LOG_OPTIONS}")
endif()

# KS: If logger is set to off many functions which sole purpose is to print message will not print anything. Thus variable will not be used and our very picky WErrror will throw errors
if(LOG_LEVEL STREQUAL "OFF" OR LOG_LEVEL STREQUAL "CRITICAL" OR LOG_LEVEL STREQUAL "ERROR" OR LOG_LEVEL STREQUAL "WARN")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do something like

set(WIGNORE_LIST OFF CRITICAL ERROR WARN)
if(${LOG_LEVEL} IN_LIST WIGNORE_LIST)

instead for extra tidiness?

target_compile_options(MaCh3Warnings INTERFACE
-Wno-error=unused-variable
-Wno-error=unused-parameter
)
endif()
Loading