@@ -16,48 +16,54 @@ target_link_libraries(
1616add_executable (
1717 codegen_test
1818 main.cpp
19- codebuilder_test.cpp
2019 codegentestutils.cpp
2120 codegentestutils.h
2221 instructionlist_test.cpp
2322 code_analyzer/variable_type_analysis.cpp
2423 code_analyzer/list_type_analysis.cpp
2524 code_analyzer/mixed_type_analysis.cpp
26- operators/equal_comparison_test.cpp
27- operators/greater_than_test.cpp
28- operators/less_than_test.cpp
29- operators/math/add_test.cpp
30- operators/math/subtract_test.cpp
31- operators/math/multiply_test.cpp
32- operators/math/divide_test.cpp
33- operators/math/random_test.cpp
34- operators/math/random_int_test.cpp
35- operators/math/mod_test.cpp
36- operators/math/abs_test.cpp
37- operators/math/round_test.cpp
38- operators/math/floor_test.cpp
39- operators/math/ceil_test.cpp
40- operators/math/sqrt_test.cpp
41- operators/math/sin_test.cpp
42- operators/math/cos_test.cpp
43- operators/math/tan_test.cpp
44- operators/math/asin_test.cpp
45- operators/math/acos_test.cpp
46- operators/math/atan_test.cpp
47- operators/math/ln_test.cpp
48- operators/math/log10_test.cpp
49- operators/math/exp_test.cpp
50- operators/math/exp10_test.cpp
51- operators/logic/and_test.cpp
52- operators/logic/or_test.cpp
53- operators/logic/not_test.cpp
54- operators/string/string_equal_case_sensitive_test.cpp
55- operators/string/string_equal_case_insensitive_test.cpp
56- operators/string/string_concat_test.cpp
57- operators/string/string_char_test.cpp
58- operators/string/string_length_test.cpp
5925)
6026
27+ if (NOT LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp" )
28+ # TODO: Move this to the executable sources
29+ target_sources (codegen_test PUBLIC
30+ codebuilder_test.cpp
31+ operators/equal_comparison_test.cpp
32+ operators/greater_than_test.cpp
33+ operators/less_than_test.cpp
34+ operators/math/add_test.cpp
35+ operators/math/subtract_test.cpp
36+ operators/math/multiply_test.cpp
37+ operators/math/divide_test.cpp
38+ operators/math/random_test.cpp
39+ operators/math/random_int_test.cpp
40+ operators/math/mod_test.cpp
41+ operators/math/abs_test.cpp
42+ operators/math/round_test.cpp
43+ operators/math/floor_test.cpp
44+ operators/math/ceil_test.cpp
45+ operators/math/sqrt_test.cpp
46+ operators/math/sin_test.cpp
47+ operators/math/cos_test.cpp
48+ operators/math/tan_test.cpp
49+ operators/math/asin_test.cpp
50+ operators/math/acos_test.cpp
51+ operators/math/atan_test.cpp
52+ operators/math/ln_test.cpp
53+ operators/math/log10_test.cpp
54+ operators/math/exp_test.cpp
55+ operators/math/exp10_test.cpp
56+ operators/logic/and_test.cpp
57+ operators/logic/or_test.cpp
58+ operators/logic/not_test.cpp
59+ operators/string/string_equal_case_sensitive_test.cpp
60+ operators/string/string_equal_case_insensitive_test.cpp
61+ operators/string/string_concat_test.cpp
62+ operators/string/string_char_test.cpp
63+ operators/string/string_length_test.cpp
64+ )
65+ endif ()
66+
6167target_link_libraries (
6268 codegen_test
6369 GTest::gtest_main
@@ -68,3 +74,9 @@ target_link_libraries(
6874)
6975
7076gtest_discover_tests (codegen_test )
77+
78+ if (LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "llvm" )
79+ add_subdirectory (llvm )
80+ elseif (LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp" )
81+ add_subdirectory (cpp )
82+ endif ()
0 commit comments