Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 12 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,21 @@ endif()
# PUBLIC propagates to consumers; PRIVATE is SDK-internal only.
# BUILD_INTERFACE is used during the SDK build; INSTALL_INTERFACE is used
# by consumers after cmake --install.
#
# The public headers are added in a separate SYSTEM call: SYSTEM marks them as
# system includes for consumers, so a consumer building with -Wall -Wextra
# -Werror is not broken by warnings originating inside the SDK's headers (e.g.
# -Wpedantic variadic-macro or -Wconversion diagnostics). find_package consumers
# already treat an imported target's includes as system; SYSTEM extends the same
# courtesy to add_subdirectory/FetchContent consumers. The PRIVATE internal
# include dirs are deliberately kept out of this SYSTEM call so the SDK's own
# -Werror build still diagnoses warnings in its internal headers.
target_include_directories(mat
PUBLIC
SYSTEM PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/public>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/mat>
)
target_include_directories(mat
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
Expand Down
4 changes: 2 additions & 2 deletions lib/include/public/ISemanticContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace MAT_NS_BEGIN
break;

default:
assert(!"Unknown NetworkCost enum value");
assert(false && "Unknown NetworkCost enum value");
value = "";
break;
}
Expand Down Expand Up @@ -180,7 +180,7 @@ namespace MAT_NS_BEGIN
break;

default:
assert(!"Unknown NetworkType enum value");
assert(false && "Unknown NetworkType enum value");
value = "";
break;
}
Expand Down
8 changes: 6 additions & 2 deletions lib/include/public/ctmacros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@
# endif
#endif

// TODO: [MG] - ideally we'd like to use __attribute__((unused)) with gcc/clang
// Cast the argument(s) to void so the parameter is genuinely referenced. An empty
// expansion left the parameter unused under -Wunused-parameter, which broke
// consumers compiling the SDK headers with -Wextra -Werror. On Windows the Win32
// SDK provides its own UNREFERENCED_PARAMETER, so this definition only applies
// where that macro is not already defined.
#ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(...)
#define UNREFERENCED_PARAMETER(...) (void)(__VA_ARGS__)
#endif

#define OACR_USE_PTR(...)
Expand Down
Loading