cmake/Tests/ForceInclude/CMakeLists.txt
2024-11-11 15:18:55 +01:00

11 lines
347 B
CMake

cmake_minimum_required(VERSION 3.10)
project(ForceInclude C)
# Make sure the proper compiler is in use.
if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
message(FATAL_ERROR "The ForceInclude test works only with MSVC or Intel")
endif()
add_executable(foo foo.c)
set_property(SOURCE foo.c PROPERTY COMPILE_FLAGS "/FIfoo1.h /FIfoo2.h")