Skip to content

Commit 9413917

Browse files
committed
cmake: Use stricter include paths for src/ast
The target_include_directories() on parser target was leaking into other cmake targets. Making include paths stricter keeps the code more uniform. It also matters for stricter build systems like buck.
1 parent 5d1b63e commit 9413917

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc)
112112
add_flex_bison_dependency(flex_lexer bison_parser)
113113
add_library(parser STATIC ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS})
114114
target_compile_options(parser PRIVATE "-w")
115-
target_include_directories(parser PUBLIC src src/ast ${CMAKE_BINARY_DIR})
115+
target_include_directories(parser PRIVATE src src/ast ${CMAKE_BINARY_DIR})
116116

117117
include(CheckSymbolExists)
118118
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)

src/ast/passes/resource_analyser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <algorithm>
44

55
#include "ast/async_event_types.h"
6+
#include "ast/codegen_helper.h"
67
#include "bpftrace.h"
7-
#include "codegen_helper.h"
88
#include "globalvars.h"
99
#include "log.h"
1010
#include "struct.h"

tests/bpfbytecode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "bpfbytecode.h"
2+
#include "ast/passes/codegen_llvm.h"
3+
#include "ast/passes/semantic_analyser.h"
24
#include "driver.h"
35
#include "mocks.h"
4-
#include "passes/codegen_llvm.h"
5-
#include "passes/semantic_analyser.h"
66

77
#include "gtest/gtest.h"
88

0 commit comments

Comments
 (0)