Skip to content

Commit

Permalink
symbolic: Change #warning to #error (RobotLocomotion#14003)
Browse files Browse the repository at this point in the history
* symbolic: Change #warning to #error
  • Loading branch information
soonho-tri authored Sep 8, 2020
1 parent 34092c0 commit d0b6ac7
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 34 deletions.
3 changes: 1 addition & 2 deletions common/symbolic_chebyshev_basis_element.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <map>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_chebyshev_polynomial.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <ostream>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_environment.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <initializer_list>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_expression.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <algorithm> // for cpplint only
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_expression_visitor.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <stdexcept>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_formula.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <functional>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_formula_cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
/// `DRAKE_COMMON_SYMBOLIC_DETAIL_HEADER` before. Without it, you have
/// compile-time errors.
#ifndef DRAKE_COMMON_SYMBOLIC_DETAIL_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not include this file unless you implement symbolic libraries.
#error Do not include this file unless you implement symbolic libraries.
#endif

#include <memory>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_formula_visitor.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <utility>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_monomial.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <cstddef>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_monomial_basis_element.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <map>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_monomial_util.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <cstddef>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_polynomial.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <algorithm>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_polynomial_basis.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <functional>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_polynomial_basis_element.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <map>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_rational_function.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <ostream>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_variable.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <cstddef>
Expand Down
3 changes: 1 addition & 2 deletions common/symbolic_variables.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
// TODO(soonho-tri): Change to #error, when #6613 merged.
#warning Do not directly include this file. Include "drake/common/symbolic.h".
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif

#include <cstddef>
Expand Down
3 changes: 3 additions & 0 deletions tools/skylark/pybind.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ def _generate_pybind_documentation_header_impl(ctx):
target_deps = _collect_cc_header_info(ctx.attr.target_deps)

args = ctx.actions.args()

# TODO(jamiesnape): Remove this line when #14034 is resolved.
args.add("-DDRAKE_COMMON_SYMBOLIC_DETAIL_HEADER")
args.add_all(
targets.compile_flags + target_deps.compile_flags,
uniquify = True,
Expand Down

0 comments on commit d0b6ac7

Please sign in to comment.