eidheim 3 years ago
parent
commit
18f2ebceff
  1. 5
      src/project_build.cpp

5
src/project_build.cpp

@ -147,6 +147,8 @@ boost::filesystem::path Project::CMakeBuild::get_executable(const boost::filesys
return executable; return executable;
} }
const auto max_path_length_linux = 4095;
bool Project::CMakeBuild::is_valid(const boost::filesystem::path &build_path) const { bool Project::CMakeBuild::is_valid(const boost::filesystem::path &build_path) const {
if(project_path.empty() || build_path.empty()) if(project_path.empty() || build_path.empty())
return true; return true;
@ -157,6 +159,9 @@ bool Project::CMakeBuild::is_valid(const boost::filesystem::path &build_path) co
bool correct_source_dir = false; bool correct_source_dir = false;
bool correct_cmake_command = false; bool correct_cmake_command = false;
while(std::getline(input, line)) { while(std::getline(input, line)) {
if(line.size() >= max_path_length_linux) {
continue;
}
const static std::regex source_dir_regex("^.*_SOURCE_DIR:STATIC=(.*)\r?$", std::regex::optimize); const static std::regex source_dir_regex("^.*_SOURCE_DIR:STATIC=(.*)\r?$", std::regex::optimize);
const static std::regex cmake_command_regex("^CMAKE_COMMAND:INTERNAL=(.*)\r?$", std::regex::optimize); const static std::regex cmake_command_regex("^CMAKE_COMMAND:INTERNAL=(.*)\r?$", std::regex::optimize);
std::smatch sm; std::smatch sm;

Loading…
Cancel
Save