Skip to content

Commit 732fe87

Browse files
committed
added target_always_include
1 parent e4d5b97 commit 732fe87

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ include(cmake/compiler_warnings.cmake)
1717
include(cmake/doxygen.cmake)
1818
include(cmake/sanitizers.cmake)
1919
include(cmake/macro_prefix.cmake)
20+
include(cmake/always_include.cmake)
2021

2122
add_subdirectory(src)
2223
add_subdirectory(project_config)

cmake/always_include.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function(target_always_include target access file)
2+
if (MSVC)
3+
target_compile_options(${target} ${access} "/FI${file}")
4+
else()
5+
target_compile_options(${target} ${access} "-include${file}")
6+
endif()
7+
endfunction()

0 commit comments

Comments
 (0)