1
0
mirror of https://github.com/meekrosoft/fff synced 2026-01-23 00:15:59 +01:00
Files
fff/CMakeLists.txt
Yuval Peress 2eb067e5a1 Migrate build to CMake and standard github workflows
Replace makefiles with CMakeLists.txt. This will allow for IDE and
platform agnostic builds of FFF.

Update the CI for FFF to use github workflows which don't depend on MS VC.
The workflow added will verify the pull requests sent to master buy
running 'buildandtest' which mirrors the developer workflow.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-05 11:48:54 -06:00

35 lines
842 B
CMake

# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
project(fff)
set(CMAKE_CXX_STANDARD 11)
# Add the gtest library which will be used below
add_subdirectory(gtest)
# Enable ctest
enable_testing()
# Generate fff.h if fakegen.rb changed
add_custom_command(
OUTPUT
${CMAKE_CURRENT_LIST_DIR}/fff.h
COMMAND
ruby ${CMAKE_CURRENT_LIST_DIR}/fakegen.rb >> ${CMAKE_CURRENT_LIST_DIR}/fff.h
DEPENDS
${CMAKE_CURRENT_LIST_DIR}/fakegen.rb
${CMAKE_CURRENT_LIST_DIR}/LICENSE
)
add_custom_target(fff_h DEPENDS ${CMAKE_CURRENT_LIST_DIR}/fff.h)
# Add an interface library for fff.h
add_library(fff INTERFACE)
add_dependencies(fff fff_h)
target_include_directories(fff INTERFACE ${CMAKE_CURRENT_LIST_DIR})
# Add tests and samples
add_subdirectory(test)
add_subdirectory(examples)