-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (82 loc) · 2.29 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
"${EXTERNAL_GOOGLETEST_DIR}/googletest/include"
"${EXTERNAL_GOOGLETEST_DIR}/googlemock/include"
)
find_package(BISON)
find_package(FLEX)
BISON_TARGET(aidl_language_y
"aidl_language_y.yy" ${CMAKE_CURRENT_BINARY_DIR}/aidl_language_y.cpp)
FLEX_TARGET(aidl_language_l
"aidl_language_l.ll" ${CMAKE_CURRENT_BINARY_DIR}/aidl_language_l.cpp)
ADD_FLEX_BISON_DEPENDENCY(aidl_language_l aidl_language_y)
add_library(aidl-common STATIC
"aidl.cpp"
"aidl_language.cpp"
"aidl_language_l.ll"
"aidl_language_y.yy"
${FLEX_aidl_language_l_OUTPUTS}
${BISON_aidl_language_y_OUTPUTS}
"ast_cpp.cpp"
"ast_java.cpp"
"code_writer.cpp"
"generate_cpp.cpp"
"generate_java.cpp"
"generate_java_binder.cpp"
"import_resolver.cpp"
"line_reader.cpp"
"io_delegate.cpp"
"options.cpp"
"type_cpp.cpp"
"type_java.cpp"
"type_namespace.cpp"
"docs/aidl-cpp.md"
"docs/constants.md"
)
target_compile_options(aidl-common PRIVATE
# Tragically, the code is riddled with unused parameters.
-Wno-unused-parameter
# yacc dumps a lot of code *just in case*.
-Wno-unused-function
-Wno-unneeded-internal-declaration
# yacc is a tool from a more civilized age.
-Wno-deprecated-register
# yacc also has a habit of using char* over const char*.
-Wno-writable-strings
# size_t also changed a bit
-Wno-sign-compare
)
target_compile_definitions(aidl-common PRIVATE
# Make the parsing errors more helpful
YYERROR_VERBOSE
)
target_link_libraries(aidl-common base cutils)
add_executable(aidl
"main_java.cpp"
)
target_link_libraries(aidl aidl-common base)
add_executable(aidl-cpp
"main_cpp.cpp"
)
target_link_libraries(aidl-cpp aidl-common base)
# tests
add_executable(aidl_unittests
"aidl_unittest.cpp"
"ast_cpp_unittest.cpp"
"ast_java_unittest.cpp"
"generate_cpp_unittest.cpp"
"io_delegate_unittest.cpp"
"options_unittest.cpp"
"tests/end_to_end_tests.cpp"
"tests/fake_io_delegate.cpp"
"tests/main.cpp"
"tests/test_data_example_interface.cpp"
"tests/test_data_ping_responder.cpp"
"tests/test_data_string_constants.cpp"
"tests/test_util.cpp"
"type_cpp_unittest.cpp"
"type_java_unittest.cpp"
)
target_link_libraries(aidl_unittests aidl-common base gmock gtest)
gtest_discover_tests(aidl_unittests)