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

chore: remove string view lite #2307

Merged
merged 4 commits into from
Nov 29, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ include(cxxopts)
# One TBB
include(tbb)

#string-view-lite
include(DownloadStringViewLite)

if(NOT MINIMAL_BUILD)
include(zlib)
include(cares)
Expand Down
30 changes: 0 additions & 30 deletions cmake/modules/DownloadStringViewLite.cmake

This file was deleted.

1 change: 0 additions & 1 deletion tests/engine/test_falco_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
#include "falco_utils.h"
#include <nonstd/string_view.hpp>
#include <catch.hpp>

TEST_CASE("is_unix_scheme matches", "[utils]")
Expand Down
3 changes: 0 additions & 3 deletions userspace/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ set(FALCO_ENGINE_SOURCE_FILES
rule_loader_compiler.cpp)

add_library(falco_engine STATIC ${FALCO_ENGINE_SOURCE_FILES})
add_dependencies(falco_engine njson string-view-lite)

if(USE_BUNDLED_DEPS)
add_dependencies(falco_engine yamlcpp)
Expand All @@ -40,7 +39,6 @@ if(MINIMAL_BUILD)
PUBLIC
"${NJSON_INCLUDE}"
"${TBB_INCLUDE_DIR}"
"${STRING_VIEW_LITE_INCLUDE}"
"${LIBSCAP_INCLUDE_DIRS}"
"${LIBSINSP_INCLUDE_DIRS}"
"${YAMLCPP_INCLUDE_DIR}"
Expand All @@ -51,7 +49,6 @@ else()
PUBLIC
"${NJSON_INCLUDE}"
"${TBB_INCLUDE_DIR}"
"${STRING_VIEW_LITE_INCLUDE}"
"${LIBSCAP_INCLUDE_DIRS}"
"${LIBSINSP_INCLUDE_DIRS}"
"${YAMLCPP_INCLUDE_DIR}"
Expand Down
5 changes: 3 additions & 2 deletions userspace/engine/falco_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ limitations under the License.
#include <iomanip>

#include "falco_utils.h"
#include "utils.h"
#include "banned.h" // This raises a compilation error when certain functions are used

namespace falco
Expand Down Expand Up @@ -75,9 +76,9 @@ void readfile(const std::string& filename, std::string& data)
}
namespace network
{
bool is_unix_scheme(nonstd::string_view url)
bool is_unix_scheme(const std::string& url)
{
return url.starts_with(UNIX_SCHEME);
return sinsp_utils::startswith(url, UNIX_SCHEME);
}
} // namespace network
} // namespace utils
Expand Down
3 changes: 1 addition & 2 deletions userspace/engine/falco_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ limitations under the License.
#include <iostream>
#include <string>
#include <thread>
#include <nonstd/string_view.hpp>

#ifdef __GNUC__
#define likely(x) __builtin_expect(!!(x), 1)
Expand All @@ -49,7 +48,7 @@ uint32_t hardware_concurrency();
namespace network
{
static const std::string UNIX_SCHEME("unix://");
bool is_unix_scheme(nonstd::string_view url);
bool is_unix_scheme(const std::string& url);
} // namespace network
} // namespace utils
} // namespace falco
2 changes: 0 additions & 2 deletions userspace/falco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ set(
"${PROJECT_SOURCE_DIR}/userspace/engine"
"${PROJECT_BINARY_DIR}/userspace/falco"
"${PROJECT_BINARY_DIR}/driver/src"
"${STRING_VIEW_LITE_INCLUDE}"
"${CXXOPTS_INCLUDE_DIR}"
"${YAMLCPP_INCLUDE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
Expand All @@ -73,7 +72,6 @@ list(APPEND FALCO_INCLUDE_DIRECTORIES "${FALCO_EXTRA_INCLUDE_DIRS}")

set(
FALCO_DEPENDENCIES
string-view-lite
b64
cxxopts
)
Expand Down