Merge branch 'fix-include_directories-whitespace-handling' into release
This commit is contained in:
commit
4b9188825a
|
@ -116,14 +116,20 @@ void cmIncludeDirectoryCommand::GetIncludes(const std::string &arg,
|
|||
{
|
||||
std::string inc = arg.substr(lastPos,pos);
|
||||
this->NormalizeInclude(inc);
|
||||
if (!inc.empty())
|
||||
{
|
||||
incs.push_back(inc);
|
||||
}
|
||||
}
|
||||
lastPos = pos + 1;
|
||||
}
|
||||
std::string inc = arg.substr(lastPos);
|
||||
this->NormalizeInclude(inc);
|
||||
if (!inc.empty())
|
||||
{
|
||||
incs.push_back(inc);
|
||||
}
|
||||
}
|
||||
|
||||
void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc)
|
||||
{
|
||||
|
@ -133,6 +139,11 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc)
|
|||
{
|
||||
inc.assign(inc, b, 1+e-b); // copy the remaining substring
|
||||
}
|
||||
else
|
||||
{
|
||||
inc = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cmSystemTools::IsOff(inc.c_str()))
|
||||
{
|
||||
|
|
|
@ -58,3 +58,14 @@ get_property(propContentAfter DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
|
|||
if (NOT propContentAfter STREQUAL "")
|
||||
message(SEND_ERROR "Clearing DIRECTORY property failed.")
|
||||
endif()
|
||||
|
||||
add_library(empty_entry_test SHARED empty.cpp)
|
||||
set_target_properties(empty_entry_test PROPERTIES INCLUDE_DIRECTORIES "")
|
||||
include_directories(/one/two
|
||||
" "
|
||||
" "
|
||||
)
|
||||
get_target_property(incs empty_entry_test INCLUDE_DIRECTORIES)
|
||||
if (NOT incs STREQUAL ";/one/two")
|
||||
message(SEND_ERROR "Empty include_directories entry was not ignored.")
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int empty() { return 0; }
|
Loading…
Reference in New Issue