Files
LXC/tests/CMakeLists.txt
2025-08-20 21:37:58 +01:00

31 lines
833 B
CMake

# Creates the binary to run the tests, the order they appear here is the order that they are run #
# For exampe, the parser tests require the lexer to be working so they must be run after #
add_executable(LXC_Tests
src/LexerTests.cpp
src/ParserTests.cpp
)
# Creates the shared precompiled header #
target_include_directories(LXC_Tests PRIVATE ${CMAKE_SOURCE_DIR}/external/util)
target_precompile_headers(LXC_Tests PRIVATE ${CMAKE_SOURCE_DIR}/external/util/Util.h)
# Includes headers for modules to test #
target_include_directories(LXC_Tests PRIVATE
${CMAKE_SOURCE_DIR}/lexer/inc
${CMAKE_SOURCE_DIR}/parser/inc
)
# Links with all needed libraries #
target_link_libraries(LXC_Tests
# Testing libraries #
gtest
gtest_main
# Libraries to test #
Parser
Lexer
)
# Registers the test to be run #
include(GoogleTest)