From 52475588ae5e3f73f60ebb5415414bd375d135af Mon Sep 17 00:00:00 2001 From: Gunnar Roth Date: Wed, 10 Oct 2018 16:47:49 +0200 Subject: [PATCH] handle header without extension --- cmake/sanitize-helpers.cmake | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 cmake/sanitize-helpers.cmake diff --git a/cmake/sanitize-helpers.cmake b/cmake/sanitize-helpers.cmake old mode 100644 new mode 100755 index 610f895..3649b07 --- a/cmake/sanitize-helpers.cmake +++ b/cmake/sanitize-helpers.cmake @@ -25,6 +25,11 @@ # Helper function to get the language of a source file. function (sanitizer_lang_of_source FILE RETURN_VAR) get_filename_component(LONGEST_EXT "${FILE}" EXT) + # If extension is empty return. This can happen for extensionless headers + if("${LONGEST_EXT}" STREQUAL "") + set(${RETURN_VAR} "" PARENT_SCOPE) + return() + endif() # Get shortest extension as some files can have dot in their names string(REGEX REPLACE "^.*(\\.[^.]+)$" "\\1" FILE_EXT ${LONGEST_EXT}) string(TOLOWER "${FILE_EXT}" FILE_EXT)