Skip to content

Commit be3284d

Browse files
pcaspersjenkins
authored andcommitted
prevent cpp from being written to all-header file
1 parent 821eccb commit be3284d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cmake/writeAll.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ function(writeAll dir output autoLink headers)
1818
file(APPEND ${output} "\n")
1919
foreach(file ${headers})
2020
file(APPEND ${output} "#include <${dir}/${file}>\n")
21+
get_filename_component(extension ${file} EXT)
22+
if(NOT "${extension}" STREQUAL ".hpp" AND NOT "${extension}" STREQUAL ".h")
23+
message(FATAL_ERROR "${file} does not end on hpp or h, this can not be written to ${output}")
24+
endif()
2125
endforeach(file)
2226
endfunction()

0 commit comments

Comments
 (0)