-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workspace] Build tinyxml2 from source (#17830)
* [workspace] Build tinyxml2 from source Deprecate the repository rule for the OS library.
- Loading branch information
1 parent
a23c0fd
commit 78eaea8
Showing
24 changed files
with
113 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ brew '[email protected]' | |
brew 'spdlog' | ||
brew 'suite-sparse' | ||
brew 'tinyxml' | ||
# TODO(jwnimmer-tri) Drop tinyxml2 as of the deprecation 2023-01-01. | ||
# Ditto for the Ubuntu prereqs. | ||
brew 'tinyxml2' | ||
brew 'robotlocomotion/director/[email protected]' | ||
brew 'xz' | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,7 +232,6 @@ cc_library( | |
"//common:drake_marker_shared_library", | ||
"@lcm", | ||
"@spdlog", | ||
"@tinyxml2", | ||
], | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- python -*- | ||
|
||
load("//tools/lint:lint.bzl", "add_lint_tests") | ||
|
||
add_lint_tests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- python -*- | ||
|
||
load( | ||
"@drake//tools/install:install.bzl", | ||
"install", | ||
) | ||
|
||
licenses(["notice"]) # zlib | ||
|
||
package(default_visibility = ["//visibility:private"]) | ||
|
||
cc_library( | ||
name = "tinyxml2", | ||
hdrs = ["tinyxml2.h"], | ||
srcs = ["tinyxml2.cpp"], | ||
include_prefix = "drake_vendor", | ||
linkstatic = 1, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
install( | ||
name = "install", | ||
docs = ["LICENSE.txt"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Add a drake_vendor namespace ala tools/workspace/vendor_cxx | ||
|
||
This prevents link-time symbol conflicts in case code downstream of | ||
Drake wants to use a different build of tinyxml2. | ||
|
||
Note that the upstream source repository contains windows newlines | ||
throughout, so we need to entertain `^M` shrapnel throughout this | ||
patch file. | ||
|
||
--- tinyxml2.h.orig 2021-06-06 17:10:24.000000000 -0700 | ||
+++ tinyxml2.h 2022-09-03 07:30:36.319764029 -0700 | ||
@@ -42,6 +42,8 @@ | ||
#endif | ||
#include <stdint.h> | ||
|
||
+inline namespace drake_vendor __attribute__ ((visibility ("hidden"))) { | ||
+ | ||
/* | ||
TODO: intern strings instead of allocation. | ||
*/ | ||
@@ -2377,4 +2379,6 @@ | ||
# pragma warning(pop) | ||
#endif | ||
|
||
+} // namespace drake_vendor | ||
+ | ||
#endif // TINYXML2_INCLUDED | ||
--- tinyxml2.cpp.orig 2021-06-06 17:10:24.000000000 -0700 | ||
+++ tinyxml2.cpp 2022-09-03 07:31:12.036248705 -0700 | ||
@@ -32,6 +32,8 @@ | ||
# include <cstdarg> | ||
#endif | ||
|
||
+inline namespace drake_vendor __attribute__ ((visibility ("hidden"))) { | ||
+ | ||
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE) | ||
// Microsoft Visual Studio, version 2005 and higher. Not WinCE. | ||
/*int _snprintf_s( | ||
@@ -2984,3 +2986,5 @@ | ||
} | ||
|
||
} // namespace tinyxml2 | ||
+ | ||
+} // namespace drake_vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- python -*- | ||
|
||
load("@drake//tools/workspace:github.bzl", "github_archive") | ||
|
||
def tinyxml2_internal_repository( | ||
name, | ||
mirrors = None): | ||
github_archive( | ||
name = name, | ||
repository = "leethomason/tinyxml2", | ||
commit = "9.0.0", | ||
sha256 = "cc2f1417c308b1f6acc54f88eb70771a0bf65f76282ce5c40e54cfe52952702c", # noqa | ||
build_file = ":package.BUILD.bazel", | ||
patches = [ | ||
":patches/namespace.patch", | ||
], | ||
mirrors = mirrors, | ||
) |