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

CMake: Warn Unknown Build Type #563

Merged
Merged
Changes from all 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
11 changes: 10 additions & 1 deletion cmake/HiPACEFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ macro(set_default_build_type default_build_type)
set_property(CACHE CMAKE_BUILD_TYPE
PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
endif()
if(NOT CMAKE_BUILD_TYPE IN_LIST CMAKE_CONFIGURATION_TYPES)
message(WARNING "CMAKE_BUILD_TYPE '${CMAKE_BUILD_TYPE}' is not one of "
"${CMAKE_CONFIGURATION_TYPES}. Is this a typo?")
endif()
endif()
endmacro()

Expand Down Expand Up @@ -219,7 +223,12 @@ function(hipace_print_summary)
message(" python: ${CMAKE_INSTALL_PYTHONDIR}")
endif()
message("")
message(" Build type: ${CMAKE_BUILD_TYPE}")
set(BLD_TYPE_UNKNOWN "")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR AND
NOT CMAKE_BUILD_TYPE IN_LIST CMAKE_CONFIGURATION_TYPES)
set(BLD_TYPE_UNKNOWN " (unknown type, check warning)")
endif()
message(" Build type: ${CMAKE_BUILD_TYPE}${BLD_TYPE_UNKNOWN}")
#if(BUILD_SHARED_LIBS)
# message(" Library: shared")
#else()
Expand Down