From f137b927b6b2199539e6e9004de4c5593078b9b6 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Fri, 27 May 2022 15:47:29 +0200 Subject: Refactor ms_craziness.h --- src/build_settings.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/build_settings.cpp') diff --git a/src/build_settings.cpp b/src/build_settings.cpp index b458d8308..9c996aef3 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -1221,12 +1221,13 @@ bool init_build_paths(String init_filename) { } if (bc->pdb_filepath.len > 0) { - bc->build_paths[BuildPath_PDB] = path_from_string(ha, bc->pdb_filepath); + bc->build_paths[BuildPath_PDB] = path_from_string(ha, bc->pdb_filepath); } if ((bc->command_kind & Command__does_build) && (!bc->ignore_microsoft_magic)) { // NOTE(ic): It would be nice to extend this so that we could specify the Visual Studio version that we want instead of defaulting to the latest. Find_Result_Utf8 find_result = find_visual_studio_and_windows_sdk_utf8(); + defer (mc_free_all()); if (find_result.windows_sdk_version == 0) { gb_printf_err("Windows SDK not found.\n"); @@ -1256,13 +1257,6 @@ bool init_build_paths(String init_filename) { bc->build_paths[BuildPath_VS_LIB] = path_from_string(ha, find_result.vs_library_path); } } - - gb_free(ha, find_result.windows_sdk_root.text); - gb_free(ha, find_result.windows_sdk_um_library_path.text); - gb_free(ha, find_result.windows_sdk_ucrt_library_path.text); - gb_free(ha, find_result.vs_exe_path.text); - gb_free(ha, find_result.vs_library_path.text); - } #endif @@ -1344,9 +1338,9 @@ bool init_build_paths(String init_filename) { output_name.len -= 1; } output_name = remove_directory_from_path(output_name); - output_name = remove_extension_from_path(output_name); - output_name = copy_string(ha, string_trim_whitespace(output_name)); - output_path = path_from_string(ha, output_name); + output_name = remove_extension_from_path(output_name); + output_name = copy_string(ha, string_trim_whitespace(output_name)); + output_path = path_from_string(ha, output_name); // Replace extension. if (output_path.ext.len > 0) { -- cgit v1.2.3