@@ -7,53 +7,223 @@ using namespace filesystem;
77
88void __declspec (dllexport) main(void )
99{
10- // Project p (L"sharedItems");
11- // p .New(projecttype_CppSharedItemsProject);
10+ // Project proj (L"sharedItems");
11+ // proj .New(projecttype_CppSharedItemsProject);
1212
13- // p .SetSaveDirectory(L".");
14- // p .Save();
13+ // proj .SetSaveDirectory(L".");
14+ // proj .Save();
1515
16- Project p (L" ninja " );
16+ Project proj (L" gn " );
1717
18- p .SetSaveDirectory (LR"( C:\PrototypingQuick\CrashPad\crashpad3\ninja\src )" );
19- // p .SetVsVersion(2019);
20- p .AddPlatform (L" x64" );
21-
22- for ( auto & pit : directory_iterator (p. GetSaveDirectory ()))
18+ proj .SetSaveDirectory (LR"( D:\Prototyping\crashpad\gn )" );
19+ // proj .SetVsVersion(2019);
20+ proj .AddPlatform (L" x64" );
21+
22+ string files[] =
2323 {
24- auto & filePath = pit.path ();
24+ " base/callback_internal.cc" ,
25+ " base/command_line.cc" ,
26+ " base/environment.cc" ,
27+ " base/files/file.cc" ,
28+ " base/files/file_enumerator.cc" ,
29+ " base/files/file_path.cc" ,
30+ " base/files/file_path_constants.cc" ,
31+ " base/files/file_util.cc" ,
32+ " base/files/scoped_file.cc" ,
33+ " base/files/scoped_temp_dir.cc" ,
34+ " base/json/json_parser.cc" ,
35+ " base/json/json_reader.cc" ,
36+ " base/json/json_writer.cc" ,
37+ " base/json/string_escape.cc" ,
38+ " base/logging.cc" ,
39+ " base/md5.cc" ,
40+ " base/memory/ref_counted.cc" ,
41+ " base/memory/weak_ptr.cc" ,
42+ " base/sha1.cc" ,
43+ " base/strings/string_number_conversions.cc" ,
44+ " base/strings/string_piece.cc" ,
45+ " base/strings/string_split.cc" ,
46+ " base/strings/string_util.cc" ,
47+ " base/strings/string_util_constants.cc" ,
48+ " base/strings/stringprintf.cc" ,
49+ " base/strings/utf_string_conversion_utils.cc" ,
50+ " base/strings/utf_string_conversions.cc" ,
51+ " base/third_party/icu/icu_utf.cc" ,
52+ " base/timer/elapsed_timer.cc" ,
53+ " base/value_iterators.cc" ,
54+ " base/values.cc" ,
55+
56+ " tools/gn/action_target_generator.cc" ,
57+ " tools/gn/action_values.cc" ,
58+ " tools/gn/analyzer.cc" ,
59+ " tools/gn/args.cc" ,
60+ " tools/gn/binary_target_generator.cc" ,
61+ " tools/gn/builder.cc" ,
62+ " tools/gn/builder_record.cc" ,
63+ " tools/gn/build_settings.cc" ,
64+ " tools/gn/bundle_data.cc" ,
65+ " tools/gn/bundle_data_target_generator.cc" ,
66+ " tools/gn/bundle_file_rule.cc" ,
67+ " tools/gn/c_include_iterator.cc" ,
68+ " tools/gn/c_substitution_type.cc" ,
69+ " tools/gn/c_tool.cc" ,
70+ " tools/gn/command_analyze.cc" ,
71+ " tools/gn/command_args.cc" ,
72+ " tools/gn/command_check.cc" ,
73+ " tools/gn/command_clean.cc" ,
74+ " tools/gn/command_desc.cc" ,
75+ " tools/gn/command_format.cc" ,
76+ " tools/gn/command_gen.cc" ,
77+ " tools/gn/command_help.cc" ,
78+ " tools/gn/command_meta.cc" ,
79+ " tools/gn/command_ls.cc" ,
80+ " tools/gn/command_path.cc" ,
81+ " tools/gn/command_refs.cc" ,
82+ " tools/gn/commands.cc" ,
83+ " tools/gn/compile_commands_writer.cc" ,
84+ " tools/gn/config.cc" ,
85+ " tools/gn/config_values.cc" ,
86+ " tools/gn/config_values_extractors.cc" ,
87+ " tools/gn/config_values_generator.cc" ,
88+ " tools/gn/copy_target_generator.cc" ,
89+ " tools/gn/create_bundle_target_generator.cc" ,
90+ " tools/gn/deps_iterator.cc" ,
91+ " tools/gn/desc_builder.cc" ,
92+ " tools/gn/eclipse_writer.cc" ,
93+ " tools/gn/err.cc" ,
94+ " tools/gn/escape.cc" ,
95+ " tools/gn/exec_process.cc" ,
96+ " tools/gn/filesystem_utils.cc" ,
97+ " tools/gn/function_exec_script.cc" ,
98+ " tools/gn/function_foreach.cc" ,
99+ " tools/gn/function_forward_variables_from.cc" ,
100+ " tools/gn/function_get_label_info.cc" ,
101+ " tools/gn/function_get_path_info.cc" ,
102+ " tools/gn/function_get_target_outputs.cc" ,
103+ " tools/gn/function_process_file_template.cc" ,
104+ " tools/gn/function_read_file.cc" ,
105+ " tools/gn/function_rebase_path.cc" ,
106+ " tools/gn/functions.cc" ,
107+ " tools/gn/function_set_defaults.cc" ,
108+ " tools/gn/function_set_default_toolchain.cc" ,
109+ " tools/gn/functions_target.cc" ,
110+ " tools/gn/function_template.cc" ,
111+ " tools/gn/function_toolchain.cc" ,
112+ " tools/gn/function_write_file.cc" ,
113+ " tools/gn/general_tool.cc" ,
114+ " tools/gn/generated_file_target_generator.cc" ,
115+ " tools/gn/group_target_generator.cc" ,
116+ " tools/gn/header_checker.cc" ,
117+ " tools/gn/import_manager.cc" ,
118+ " tools/gn/inherited_libraries.cc" ,
119+ " tools/gn/input_conversion.cc" ,
120+ " tools/gn/input_file.cc" ,
121+ " tools/gn/input_file_manager.cc" ,
122+ " tools/gn/item.cc" ,
123+ " tools/gn/json_project_writer.cc" ,
124+ " tools/gn/label.cc" ,
125+ " tools/gn/label_pattern.cc" ,
126+ " tools/gn/lib_file.cc" ,
127+ " tools/gn/loader.cc" ,
128+ " tools/gn/location.cc" ,
129+ " tools/gn/metadata.cc" ,
130+ " tools/gn/metadata_walk.cc" ,
131+ " tools/gn/ninja_action_target_writer.cc" ,
132+ " tools/gn/ninja_binary_target_writer.cc" ,
133+ " tools/gn/ninja_build_writer.cc" ,
134+ " tools/gn/ninja_bundle_data_target_writer.cc" ,
135+ " tools/gn/ninja_c_binary_target_writer.cc" ,
136+ " tools/gn/ninja_copy_target_writer.cc" ,
137+ " tools/gn/ninja_create_bundle_target_writer.cc" ,
138+ " tools/gn/ninja_generated_file_target_writer.cc" ,
139+ " tools/gn/ninja_group_target_writer.cc" ,
140+ " tools/gn/ninja_target_command_util.cc" ,
141+ " tools/gn/ninja_target_writer.cc" ,
142+ " tools/gn/ninja_toolchain_writer.cc" ,
143+ " tools/gn/ninja_utils.cc" ,
144+ " tools/gn/ninja_writer.cc" ,
145+ " tools/gn/operators.cc" ,
146+ " tools/gn/output_conversion.cc" ,
147+ " tools/gn/output_file.cc" ,
148+ " tools/gn/parse_node_value_adapter.cc" ,
149+ " tools/gn/parser.cc" ,
150+ " tools/gn/parse_tree.cc" ,
151+ " tools/gn/path_output.cc" ,
152+ " tools/gn/pattern.cc" ,
153+ " tools/gn/pool.cc" ,
154+ " tools/gn/qt_creator_writer.cc" ,
155+ " tools/gn/runtime_deps.cc" ,
156+ " tools/gn/scheduler.cc" ,
157+ " tools/gn/scope.cc" ,
158+ " tools/gn/scope_per_file_provider.cc" ,
159+ " tools/gn/settings.cc" ,
160+ " tools/gn/setup.cc" ,
161+ " tools/gn/source_dir.cc" ,
162+ " tools/gn/source_file.cc" ,
163+ " tools/gn/standard_out.cc" ,
164+ " tools/gn/string_utils.cc" ,
165+ " tools/gn/substitution_list.cc" ,
166+ " tools/gn/substitution_pattern.cc" ,
167+ " tools/gn/substitution_type.cc" ,
168+ " tools/gn/substitution_writer.cc" ,
169+ " tools/gn/switches.cc" ,
170+ " tools/gn/target.cc" ,
171+ " tools/gn/target_generator.cc" ,
172+ " tools/gn/template.cc" ,
173+ " tools/gn/token.cc" ,
174+ " tools/gn/tokenizer.cc" ,
175+ " tools/gn/tool.cc" ,
176+ " tools/gn/toolchain.cc" ,
177+ " tools/gn/trace.cc" ,
178+ " tools/gn/value.cc" ,
179+ " tools/gn/value_extractors.cc" ,
180+ " tools/gn/variables.cc" ,
181+ " tools/gn/visibility.cc" ,
182+ " tools/gn/visual_studio_utils.cc" ,
183+ " tools/gn/visual_studio_writer.cc" ,
184+ " tools/gn/xcode_object.cc" ,
185+ " tools/gn/xcode_writer.cc" ,
186+ " tools/gn/xml_element_writer.cc" ,
187+ " util/exe_path.cc" ,
188+ " util/msg_loop.cc" ,
189+ " util/semaphore.cc" ,
190+ " util/sys_info.cc" ,
191+ " util/ticks.cc" ,
192+ " util/worker_pool.cc" ,
193+
25194
26- if (is_directory (filePath))
27- continue ;
195+ " base/files/file_enumerator_win.cc" ,
196+ " base/files/file_util_win.cc" ,
197+ " base/files/file_win.cc" ,
198+ " base/win/registry.cc" ,
199+ " base/win/scoped_handle.cc" ,
200+ " base/win/scoped_process_information.cc" ,
28201
29- auto fname = lowercase (filePath.stem ().u8string ());
30- auto ext = lowercase (filePath.extension ().u8string ());
31- transform (ext.begin (), ext.end (), ext.begin (), tolower);
202+ " tools/gn/gn_main.cc"
203+ };
32204
33- if (fname == " browse " || fname == " subprocess-posix " || fname == " test " /* || fname == "msvc_helper_main-win32" */ )
34- continue ;
205+ for ( auto strPath : files )
206+ proj. AddFile ( path (strPath). c_str ()) ;
35207
36- if (fname.find (" test" ) != -1 || fname.find (" .in" ) != -1 || fname.find (" bench" ) != -1 )
37- continue ;
38-
39- if (ext == " .h" || ext == " .cc" || ext == " .c" )
40- p.AddFile (filePath.c_str ());
41- }
208+ wstring defines = L" NDEBUG;NOMINMAX;UNICODE;WIN32_LEAN_AND_MEAN;WINVER=0x0A00;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;_UNICODE;_WIN32_WINNT=0x0A00" ;
42209
43- p .VisitConfigurations (
44- [](VCConfiguration& c)
210+ proj .VisitConfigurations (
211+ [& ](VCConfiguration& c)
45212 {
46213 c.General .IntDir = LR"( obj\$(ProjectName)_$(Configuration)_$(Platform)\)" ;
47214 c.General .OutDir = LR"( bin\$(Configuration)_$(Platform)\)" ;
48215 c.General .UseDebugLibraries = true ;
49216 c.General .LinkIncremental = true ;
50217 c.CCpp .Optimization .Optimization = optimization_Disabled;
218+ c.CCpp .General .AdditionalIncludeDirectories = L" .;out" ;
219+ c.CCpp .Preprocessor .PreprocessorDefinitions = defines + L" ;%(PreprocessorDefinitions)" ;
51220 c.Linker .System .SubSystem = subsystem_Console;
221+ c.Linker .Input .AdditionalDependencies = L" ws2_32.lib;Shlwapi.lib;%(AdditionalDependencies)" ;
52222 c.Linker .Debugging .GenerateDebugInformation = debuginfo_true;
53223 }
54224 );
55225
56- // auto f = p .File(L"..\\SolutionProjectModel.dll", true);
226+ // auto f = proj .File(L"..\\SolutionProjectModel.dll", true);
57227 // f->General.ItemType = CustomBuild;
58228 // f->VisitTool(
59229 // [](PlatformConfigurationProperties* props)
@@ -68,12 +238,12 @@ void __declspec(dllexport) main(void)
68238 // }
69239 // , &CustomBuildToolProperties::GetType());
70240
71- p .Save ();
241+ proj .Save ();
72242
73- // Project p (L"emptyProject");
74- // p .SetSaveDirectory(L".");
75- // p .AddPlatform(L"x64");
76- // p .Save();
243+ // Project proj (L"emptyProject");
244+ // proj .SetSaveDirectory(L".");
245+ // proj .AddPlatform(L"x64");
246+ // proj .Save();
77247
78248}
79249
0 commit comments