Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move into third_party/com_github_tcbrindle_cpp17_headers #7241

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ DRAKE_EXTERNAL_PACKAGE_INSTALLS = ["@%s//:install" % p for p in [
"sdformat",
"spdlog",
"spruce",
"stx",
"tinydir",
"tinyobjloader",
"vtk",
Expand Down
6 changes: 6 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ new_local_repository(
path = "third_party/josephdavisco_spruce",
)

new_local_repository(
name = "stx",
build_file = "tools/workspace/stx/stx.BUILD",
path = "third_party/com_github_tcbrindle_cpp17_headers",
)

load("@kythe//tools/build_rules/config:pkg_config.bzl", "pkg_config_package")

pkg_config_package(
Expand Down
9 changes: 8 additions & 1 deletion drake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ target_include_directories(spruce
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../third_party/josephdavisco_spruce>)
drake_install_libraries(spruce)

add_subdirectory(thirdParty/boost/tcbrindle_cpp17_headers/stx)
# stx (via third_party)
add_library(stx ../third_party/com_github_tcbrindle_cpp17_headers/stx/optional.hpp)
target_include_directories(stx PUBLIC ../third_party/com_github_tcbrindle_cpp17_headers)
set_target_properties(stx PROPERTIES LINKER_LANGUAGE CXX)
drake_install_libraries(stx)
install(FILES ../third_party/com_github_tcbrindle_cpp17_headers/stx/optional.hpp
DESTINATION "${DRAKE_INSTALL_INCLUDE_DIR}/stx/stx/optional.hpp")

add_subdirectory(common)
add_subdirectory(math)
add_subdirectory(multibody)
Expand Down
6 changes: 0 additions & 6 deletions drake/CPPLINT.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@

# It's not worth lint-gardening the documentation.
exclude_files=doc

# Ignore built files (versus in-tree files).
exclude_files=pod-build

# Ignore code that isn't ours.
exclude_files=thirdParty
3 changes: 3 additions & 0 deletions drake/bindings/pybind.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def drake_pybind_cc_binary(name, srcs = [], copts = [], **kwargs):
# include path, and its prerequisite *.so's onto LD_LIBRARY_PATH.
"//drake:drake_shared_library",
"@pybind11",
# TODO(jwnimmer-tri) We should be getting stx header path from
# :drake_shared_library, but that isn't working yet.
"@stx",
],
**kwargs
)
1 change: 0 additions & 1 deletion drake/build_components.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ LIBDRAKE_COMPONENTS = [
"//drake/systems/trajectory_optimization:direct_collocation",
"//drake/systems/trajectory_optimization:direct_transcription",
"//drake/systems/trajectory_optimization:multiple_shooting",
"//drake/thirdParty:stx",
"//drake/util:convex_hull",
"//drake/util:lcm_util",
"//drake/util:util",
Expand Down
2 changes: 1 addition & 1 deletion drake/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ drake_cc_library(
"text_logging.h",
],
deps = [
"//drake/thirdParty:stx",
"@eigen",
"@spdlog",
"@stx",
],
)

Expand Down
2 changes: 1 addition & 1 deletion drake/common/drake_optional.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "drake/thirdParty/boost/tcbrindle_cpp17_headers/stx/optional.hpp"
#include <stx/optional.hpp>

/// @file
/// Provides drake::optional as an alias for the appropriate implementation of
Expand Down
18 changes: 0 additions & 18 deletions drake/thirdParty/BUILD.bazel

This file was deleted.

4 changes: 0 additions & 4 deletions drake/thirdParty/README.md

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions drake/thirdParty/bsd/README.md

This file was deleted.

1 change: 0 additions & 1 deletion drake/tools/clang_format_includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def main():
for dirpath, _, filenames in os.walk(pathname)
for filename in filenames
if os.path.splitext(filename)[1][1:] in extensions and
"/thirdParty/" not in dirpath and
"/third_party/" not in dirpath and
"/matlab/" not in dirpath
]
Expand Down
23 changes: 23 additions & 0 deletions third_party/com_github_tcbrindle_cpp17_headers/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions tools/drake.cps
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
"Hints": ["@prefix@/lib/cmake/spdlog"],
"X-CMake-Find-Args": ["CONFIG"]
},
"stx": {
"Hints": ["@prefix@/lib/cmake/stx"],
"X-CMake-Find-Args": ["CONFIG"]
},
"tinyobjloader": {
"Version": "1.0.4",
"Hints": ["@prefix@/lib/cmake/tinyobjloader"],
Expand Down
6 changes: 6 additions & 0 deletions tools/workspace/stx/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- python -*-

exports_files(
["stx.cps"],
visibility = ["@stx//:__pkg__"],
)
38 changes: 38 additions & 0 deletions tools/workspace/stx/stx.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- python -*-

load(
"@drake//tools:install.bzl",
"cmake_config",
"install",
"install_cmake_config",
)

package(default_visibility = ["//visibility:public"])

cc_library(
name = "stx",
hdrs = ["stx/optional.hpp"],
includes = ["."],
)

CMAKE_PACKAGE = "stx"

cmake_config(package = CMAKE_PACKAGE)

install_cmake_config(
package = CMAKE_PACKAGE,
versioned = 0,
)

install(
name = "install",
targets = [":stx"],
hdr_dest = "include/stx",
guess_hdrs = "PACKAGE",
docs = [
"LICENSE",
],
deps = [
":install_cmake_config",
],
)
13 changes: 13 additions & 0 deletions tools/workspace/stx/stx.cps
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Cps-Version": "0.8.0",
"Name": "stx",
"Description": "C++17 library facilities for older compilers",
"License": "BSL-1.0",
"Default-Components": [":stx"],
"Components": {
"stx": {
"Type": "interface",
"Includes": ["@prefix@/include/stx"]
}
}
}