refactor(macros): added macros class

macros provides a unified place to define macros which can be accessed at other points in the code. I defined a DEPRICATION_WARNING_OFF macro so we can disable those warnings for times when we cannot control them
This commit is contained in:
2025-02-20 16:04:05 -05:00
parent ff299f8ce7
commit 776174c093
5 changed files with 23 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ libPolySolver = static_library('polySolver',
polySolver_sources, polySolver_sources,
include_directories : include_directories('./public'), include_directories : include_directories('./public'),
cpp_args: ['-fvisibility=default'], cpp_args: ['-fvisibility=default'],
dependencies: [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep], dependencies: [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep, warning_control_dep],
install: true install: true
) )
@@ -18,5 +18,5 @@ polysolver_dep = declare_dependency(
include_directories : include_directories('./public'), include_directories : include_directories('./public'),
link_with : libPolySolver, link_with : libPolySolver,
sources : polySolver_sources, sources : polySolver_sources,
dependencies : [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep] dependencies : [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep, warning_control_dep]
) )

View File

@@ -12,7 +12,7 @@ libpolyutils = static_library('polyutils',
polyutils_sources, polyutils_sources,
include_directories : include_directories('./public'), include_directories : include_directories('./public'),
cpp_args: ['-fvisibility=default'], cpp_args: ['-fvisibility=default'],
dependencies: [mfem_dep], dependencies: [mfem_dep, warning_control_dep],
install: true install: true
) )
@@ -20,5 +20,5 @@ polyutils_dep = declare_dependency(
include_directories : include_directories('./public'), include_directories : include_directories('./public'),
link_with : libpolyutils, link_with : libpolyutils,
sources : polyutils_sources, sources : polyutils_sources,
dependencies : [mfem_dep] dependencies : [mfem_dep, warning_control_dep]
) )

View File

@@ -0,0 +1 @@
warning_control_dep = declare_dependency(include_directories: include_directories('.'))

View File

@@ -0,0 +1,16 @@
#ifndef WARNING_CONTROL_H
#define WARNING_CONTROL_H
#if defined(__GNUC__) || defined(__clang__)
#define DEPRECATION_WARNING_OFF _Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define DEPRECATION_WARNING_ON _Pragma("GCC diagnostic pop")
#elif defined(_MSC_VER)
#define DEPRECATION_WARNING_OFF __pragma(warning(push)) __pragma(warning(disable: 4996))
#define DEPRECATION_WARNING_ON __pragma(warning(pop))
#else
#define DEPRECATION_WARNING_OFF
#define DEPRECATION_WARNING_ON
#endif
#endif // WARNING_CONTROL_H

View File

@@ -1 +1,2 @@
subdir('const') subdir('const')
subdir('macros')