Skip to content

Commit

Permalink
build(main): allow disabling all deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Aug 20, 2023
1 parent ec8fe83 commit 9ef27ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ option(PHOENIX_BUILD_EXAMPLES "Build example code" OFF)
option(PHOENIX_BUILD_TESTS "Build tests" ON)
option(PHOENIX_BUILD_SHARED "Build phoenix as a shared library" OFF)
option(PHOENIX_DISABLE_SANITIZERS "Build without sanitizers in debug mode" OFF)
option(PHOENIX_DISABLE_DEPRECATION "Disable all deprecation warnings" OFF)
option(PHOENIX_INSTALL "Configure phoenix for cmake install" ON)

set(PHOENIX_DEBUG_POSTFIX d CACHE STRING "Debug library postfix.")
Expand Down Expand Up @@ -46,6 +47,10 @@ add_subdirectory(vendor)
# add log level definition
set(PHOENIX_DEFINES PHOENIX_LOG_LEVEL=${PHOENIX_LOG_LEVEL})

if (${PHOENIX_DISABLE_DEPRECATION})
set(PHOENIX_DEFINES ${PHOENIX_DEFINES} PHOENIX_NO_DEPRECATED=1)
endif ()

# find all header files; required for them to show up properly in VisualStudio
file(GLOB_RECURSE PHOENIX_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/**/*.hh")

Expand Down
4 changes: 3 additions & 1 deletion include/phoenix/Api.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@
#define PHOENIX_INTERNAL
#endif

#define PHOENIX_DEPRECATED(reason) [[deprecated(reason)]]
#if !PHOENIX_NO_DEPRECATED
#define PHOENIX_DEPRECATED(reason) [[deprecated(reason)]]
#endif

0 comments on commit 9ef27ca

Please sign in to comment.