Skip to content

Commit

Permalink
Fix vs2019 & namespace for install targets (#349)
Browse files Browse the repository at this point in the history
* Change export namespace from `s2` to `s2::`
* Add absl dependency to Config.cmake.in
* Use C++14 form of `static_assert`
  • Loading branch information
jherico authored Feb 3, 2024
1 parent 5c2190a commit 05b0694
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ install(TARGETS s2 EXPORT s2Targets)
# that they can referenced by downstream projects as `s2::s2` after a
# successful `find_package` call.
install(EXPORT s2Targets
NAMESPACE s2
NAMESPACE s2::
FILE s2Targets.cmake
DESTINATION share/s2/)

Expand Down
3 changes: 3 additions & 0 deletions Config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(absl CONFIG)

include("${CMAKE_CURRENT_LIST_DIR}/s2Targets.cmake")
2 changes: 1 addition & 1 deletion src/s2/s2lax_polygon_shape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace {
template <typename T>
unique_ptr<T> make_unique_for_overwrite(size_t n) {
// We only need to support this one variant.
static_assert(std::is_array<T>::value);
static_assert(std::is_array<T>::value, "T must be an array type");
return unique_ptr<T>(new typename absl::remove_extent_t<T>[n]);
}
} // namespace
Expand Down

0 comments on commit 05b0694

Please sign in to comment.