File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -533,11 +533,15 @@ int generate_cmake(const char *path, bool root) {
533533 j[" $schema" ] = " https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json" ;
534534 j[" name" ] = cmake.project_name ;
535535 if (cmake.project_version .empty ())
536- throw std::runtime_error (" vcpkg manifest mode requires that the project have a version string" );
536+ throw std::runtime_error (" vcpkg manifest mode requires that the project have a version string! " );
537537 j[" version" ] = cmake.project_version ;
538538 j[" dependencies" ] = cmake.vcpkg .packages ;
539539 std::ofstream ofs (" vcpkg.json" );
540+ if (!ofs) {
541+ throw std::runtime_error (" Failed to create a vcpkg.json manifest file!" );
542+ }
540543 ofs << std::setw (4 ) << j << std::endl;
544+ ofs.close ();
541545 }
542546
543547 if (!cmake.packages .empty ()) {
You can’t perform that action at this time.
0 commit comments