Skip to content

Commit

Permalink
fix cmake build
Browse files Browse the repository at this point in the history
Summary:
Workaround span compile errors on ContainsTest in C++17 by using folly::span.  It can be constructed with a pair of pointers but not with a pair of iterators of arbitrary contiguous-iterator type, since C++17 does not have the concept of contiguous iterator.

Also fix cmake paths to match the file moves done in D55706209 for NestedCommandLineApp ProgramOptions.  I think this would only cause failures when gflags is not found.

Reviewed By: yfeldblum

Differential Revision: D64401540

fbshipit-source-id: e46470ccc2282b17cd203c645f9399c98ed47db4
  • Loading branch information
ahornby authored and facebook-github-bot committed Oct 16, 2024
1 parent 88b0961 commit a53e741
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,12 @@ else()
endif()
if (NOT ${LIBGFLAGS_FOUND})
list(REMOVE_ITEM files
${FOLLY_DIR}/experimental/NestedCommandLineApp.cpp
${FOLLY_DIR}/experimental/ProgramOptions.cpp
${FOLLY_DIR}/cli/NestedCommandLineApp.cpp
${FOLLY_DIR}/cli/ProgramOptions.cpp
)
list(REMOVE_ITEM hfiles
${FOLLY_DIR}/experimental/NestedCommandLineApp.h
${FOLLY_DIR}/experimental/ProgramOptions.h
${FOLLY_DIR}/cli/NestedCommandLineApp.h
${FOLLY_DIR}/cli/ProgramOptions.h
)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down
2 changes: 1 addition & 1 deletion folly/algorithm/simd/test/ContainsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ TEST_F(ContainsTestSpeicalCases, AsanShouldDetectInvalidRange) {

std::vector<int> v;
v.resize(3);
folly::span<int> s(v.begin() + 1, v.begin() + 4);
folly::span<int> s(v.data() + 1, v.data() + 4);
EXPECT_DEATH(
(folly::simd::contains(s, 0)), "AddressSanitizer: heap-buffer-overflow");
}

0 comments on commit a53e741

Please sign in to comment.