Skip to content

Commit 1f569d1

Browse files
committed
Fix Ubuntu 20.04 build
1 parent 6dc155e commit 1f569d1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
2222
ENDIF()
2323

2424
ADD_LIBRARY(GerberParserCpp STATIC)
25-
TARGET_COMPILE_FEATURES(GerberParserCpp PRIVATE cxx_std_17)
25+
TARGET_COMPILE_FEATURES(GerberParserCpp PRIVATE cxx_std_20)
2626
SET_TARGET_PROPERTIES(GerberParserCpp
2727
PROPERTIES POSITION_INDEPENDENT_CODE ON
2828
)
@@ -52,7 +52,7 @@ CPMAddPackage(
5252
)
5353

5454
pybind11_add_module(PyGerberGerberParserCpp cpp/python/gerber_parser.cpp)
55-
target_compile_features(PyGerberGerberParserCpp PRIVATE cxx_std_17)
55+
target_compile_features(PyGerberGerberParserCpp PRIVATE cxx_std_20)
5656
target_link_libraries(
5757
PyGerberGerberParserCpp
5858
PRIVATE
@@ -72,7 +72,7 @@ CPMAddPackage("gh:catchorg/[email protected]")
7272

7373

7474
add_executable(tests)
75-
target_compile_features(tests PRIVATE cxx_std_17)
75+
target_compile_features(tests PRIVATE cxx_std_20)
7676

7777
file(GLOB_RECURSE test_source_files ${PROJECT_SOURCE_DIR}/cpp/test/ *.test.cpp)
7878
target_sources(tests PRIVATE ${test_source_files})

cpp/gerber/include/gerber/ast/enums.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <cstdint>
3+
#include <string>
34
#include <string_view>
45

56
namespace gerber {

cpp/gerber/src/parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ namespace gerber {
4242
}
4343

4444
location_t Parser::parse_global(const std::string_view& source, const location_t& index) {
45-
const std::string_view sub_source{source.begin() + index, source.end()};
45+
const std::string_view sub_source{source.begin() + index, source.size() - index};
46+
4647
if (sub_source.empty()) {
4748
return 0;
4849
}

0 commit comments

Comments
 (0)