Skip to content

Commit

Permalink
ign_build_error, ign_build_warning
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed May 17, 2022
1 parent de367f9 commit 596d260
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmake/IgnConfigureBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ macro(_gz_parse_build_type)
elseif("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "PROFILE")
set(BUILD_TYPE_PROFILE TRUE)
else()
ign_build_error("CMAKE_BUILD_TYPE [${CMAKE_BUILD_TYPE}] unknown. Valid options are: Debug Release RelWithDebInfo MinSizeRel Profile Check")
gz_build_error("CMAKE_BUILD_TYPE [${CMAKE_BUILD_TYPE}] unknown. Valid options are: Debug Release RelWithDebInfo MinSizeRel Profile Check")
endif()

endmacro()
27 changes: 22 additions & 5 deletions cmake/IgnUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ macro(gz_find_package PACKAGE_NAME)
if(gz_find_package_REQUIRED)

# If it was required by the project, we will create an error.
ign_build_error(${${PACKAGE_NAME}_msg})
gz_build_error(${${PACKAGE_NAME}_msg})

elseif(gz_find_package_REQUIRED_BY)

Expand All @@ -247,7 +247,7 @@ macro(gz_find_package PACKAGE_NAME)
# Otherwise, if it was only required by some of the components, create
# a warning about which components will not be available, unless the
# user explicitly requested that it be skipped
ign_build_warning("Skipping component [${component}]: ${${PACKAGE_NAME}_msg}.\n ^~~~~ Set SKIP_${component}=true in cmake to suppress this warning.\n ")
gz_build_warning("Skipping component [${component}]: ${${PACKAGE_NAME}_msg}.\n ^~~~~ Set SKIP_${component}=true in cmake to suppress this warning.\n ")

# Create a variable to indicate that we need to skip the component
set(INTERNAL_SKIP_${component} true)
Expand All @@ -260,7 +260,7 @@ macro(gz_find_package PACKAGE_NAME)

else()
if(NOT gz_find_package_QUIET)
ign_build_warning(${${PACKAGE_NAME}_msg})
gz_build_warning(${${PACKAGE_NAME}_msg})
endif()
endif()

Expand Down Expand Up @@ -845,21 +845,38 @@ endfunction()


#################################################
# ign_build_error macro
# gz_build_error macro
macro(ign_build_error)
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_build_error is deprecated, use gz_build_error instead.")

foreach(str ${ARGN})
set(msg "\t${str}")
list(APPEND build_errors ${msg})
endforeach()
endmacro(ign_build_error)
macro(gz_build_error)
foreach(str ${ARGN})
set(msg "\t${str}")
list(APPEND build_errors ${msg})
endforeach()
endmacro(gz_build_error)

#################################################
# ign_build_warning macro
# gz_build_warning macro
macro(ign_build_warning)
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_build_warning is deprecated, use gz_build_warning instead.")

foreach(str ${ARGN})
list(APPEND build_warnings "${str}")
endforeach(str ${ARGN})
endmacro(ign_build_warning)
macro(gz_build_warning)
foreach(str ${ARGN})
list(APPEND build_warnings "${str}")
endforeach(str ${ARGN})
endmacro(gz_build_warning)

#################################################
# _gz_check_known_cxx_standards(<11|14|17>)
Expand Down

0 comments on commit 596d260

Please sign in to comment.