31 lines
808 B
CMake
31 lines
808 B
CMake
cmake_minimum_required(VERSION 3.14)
|
|
|
|
find_package(Catch2 REQUIRED)
|
|
|
|
# LLVM is typically compiled without RTTI. Weird linker errors ensue if
|
|
# you keep RTTI on and try to link.
|
|
if (NOT LLVM_ENABLE_RTTI)
|
|
if (MSVC)
|
|
string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
|
|
else ()
|
|
string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
|
|
endif ()
|
|
endif ()
|
|
|
|
add_executable(op-finder-tests
|
|
main.cpp
|
|
fixtures/RunOnCodeFixture.cpp
|
|
basic_operations.cpp
|
|
branches.cpp)
|
|
|
|
target_link_libraries(op-finder-tests
|
|
PUBLIC
|
|
op-finder-lib
|
|
Catch2::Catch2)
|
|
|
|
include(CTest)
|
|
include(Catch)
|
|
catch_discover_tests(op-finder-tests)
|