Skip to content

Commit

Permalink
[Objective-C API] WIgnore clang documentation warnings from C/C++ hea…
Browse files Browse the repository at this point in the history
…der usage. (microsoft#9057)
  • Loading branch information
edgchen1 authored Sep 14, 2021
1 parent 3ec3e9f commit 32366fe
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 21 deletions.
28 changes: 28 additions & 0 deletions objectivec/src/cxx_api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// wrapper for ORT C/C++ API headers

#if defined(__clang__)
#pragma clang diagnostic push
// ignore clang documentation-related warnings
// instead, we will rely on Doxygen warnings for the C/C++ API headers
#pragma clang diagnostic ignored "-Wdocumentation"
#endif // defined(__clang__)

#include "onnxruntime_c_api.h"
#include "onnxruntime_cxx_api.h"

#if __has_include("coreml_provider_factory.h")
#define ORT_OBJC_API_COREML_EP_AVAILABLE 1
#else
#define ORT_OBJC_API_COREML_EP_AVAILABLE 0
#endif

#if ORT_OBJC_API_COREML_EP_AVAILABLE
#include "coreml_provider_factory.h"
#endif

#if defined(__clang__)
#pragma clang diagnostic pop
#endif // defined(__clang__)
2 changes: 1 addition & 1 deletion objectivec/src/error_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <exception>

#include "onnxruntime_cxx_api.h"
#import "src/cxx_api.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down
11 changes: 1 addition & 10 deletions objectivec/src/ort_coreml_execution_provider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@

#import "ort_coreml_execution_provider.h"

#if __has_include("coreml_provider_factory.h")
#define ORT_OBJC_API_COREML_EP_AVAILABLE 1
#else
#define ORT_OBJC_API_COREML_EP_AVAILABLE 0
#endif

#if ORT_OBJC_API_COREML_EP_AVAILABLE
#include "coreml_provider_factory.h"
#endif

#import "src/cxx_api.h"
#import "src/error_utils.h"
#import "src/ort_session_internal.h"

Expand Down
2 changes: 1 addition & 1 deletion objectivec/src/ort_enums.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <algorithm>

#include "onnxruntime_cxx_api.h"
#import "src/cxx_api.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion objectivec/src/ort_enums_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#import "ort_enums.h"

#include "onnxruntime_c_api.h"
#import "src/cxx_api.h"

OrtLoggingLevel PublicToCAPILoggingLevel(ORTLoggingLevel logging_level);

Expand Down
2 changes: 1 addition & 1 deletion objectivec/src/ort_env.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <optional>

#include "onnxruntime_cxx_api.h"
#import "src/cxx_api.h"

#import "src/error_utils.h"
#import "src/ort_enums_internal.h"
Expand Down
2 changes: 1 addition & 1 deletion objectivec/src/ort_env_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#import "ort_env.h"

#include "onnxruntime_cxx_api.h"
#import "src/cxx_api.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down
3 changes: 1 addition & 2 deletions objectivec/src/ort_session.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#include <optional>
#include <vector>

#include "onnxruntime_cxx_api.h"

#import "src/cxx_api.h"
#import "src/error_utils.h"
#import "src/ort_enums_internal.h"
#import "src/ort_env_internal.h"
Expand Down
2 changes: 1 addition & 1 deletion objectivec/src/ort_session_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#import "ort_session.h"

#include "onnxruntime_cxx_api.h"
#import "src/cxx_api.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down
3 changes: 1 addition & 2 deletions objectivec/src/ort_value.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "safeint/SafeInt.hpp"

#include "onnxruntime_cxx_api.h"

#import "src/cxx_api.h"
#import "src/error_utils.h"
#import "src/ort_enums_internal.h"

Expand Down
2 changes: 1 addition & 1 deletion objectivec/src/ort_value_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#import "ort_value.h"

#include "onnxruntime_cxx_api.h"
#import "src/cxx_api.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down

0 comments on commit 32366fe

Please sign in to comment.