Skip to content

Commit

Permalink
Fix broken bridge build
Browse files Browse the repository at this point in the history
- Multiple bridge build issues
  - Parallel meson processes targeting same folder doesn't work.
  - Meson doesn't generate a useful ninja.build that's easy to specify targets other than "all"
    - At least not with our vsgen flow
- The fix: Get rid of the four different projects, just target all with a single build command.
- REMIX-2738
  • Loading branch information
nv-nfreybler committed Feb 6, 2024
2 parents 0bc8984 + 161ff98 commit 611fac1
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 71 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
_output/
_output
_comp*
.history
_vs/**

.history
game_list.txt

test/rtx/APICs/
vsgen/__pycache__/**
12 changes: 6 additions & 6 deletions vsgen/bridge-remix.vcxproj.template
Original file line number Diff line number Diff line change
Expand Up @@ -93,47 +93,47 @@
<NMakeBuildCommandLine>ninja -C ..\_compDebug_x86</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ..\_compDebug_x86 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ..\_compDebug_x86 clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$include_search_path_debug_32</NMakeIncludeSearchPath>
<AdditionalOptions>/std:c++17 /fpermissive-</AdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>ninja -C ..\_compDebug_x64</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ..\_compDebug_x64 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ..\_compDebug_x64 clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$include_search_path_debug_64</NMakeIncludeSearchPath>
<AdditionalOptions>/std:c++17 /fpermissive-</AdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugOptimized|Win32'">
<NMakeBuildCommandLine>ninja -C ..\_compDebugOptimized_x86</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ..\_compDebugOptimized_x86 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ..\_compDebugOptimized_x86 clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$include_search_path_debugoptimized_32</NMakeIncludeSearchPath>
<AdditionalOptions>/std:c++17 /fpermissive-</AdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugOptimized|x64'">
<NMakeBuildCommandLine>ninja -C ..\_compDebugOptimized_x64</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ..\_compDebugOptimized_x64 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ..\_compDebugOptimized_x64 clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$include_search_path_debugoptimized_64</NMakeIncludeSearchPath>
<AdditionalOptions>/std:c++17 /fpermissive-</AdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<NMakeBuildCommandLine>ninja -C ..\_compRelease_x86</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ..\_compRelease_x86 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ..\_compRelease_x86 clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$include_search_path_release_32</NMakeIncludeSearchPath>
<AdditionalOptions>/std:c++17 /fpermissive-</AdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>ninja -C ..\_compRelease_x64</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ..\_compRelease_x64 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ..\_compRelease_x64 clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>$bridge_cpp_defines;</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$include_search_path_release_64</NMakeIncludeSearchPath>
<AdditionalOptions>/std:c++17 /fpermissive-</AdditionalOptions>
</PropertyGroup>
Expand Down
13 changes: 6 additions & 7 deletions vsgen/bridge_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
src_exts = [ ".cpp", ".c", ".build", ".conf" ]
all_exts = header_exts + src_exts

def generate_bridge_project(output_root_path, bridge_cpp_defines, project_base_name, sub_dir):
def generate_bridge_project(output_root_path, bridge_cpp_defines):
tree = { }
vcxproj_file_references = []
vcxproj_include_paths = { }
Expand Down Expand Up @@ -68,16 +68,15 @@ def process_tree(root, external):

for f in files:
process_file(dirpath, f, external)
sub_tree_dir = "../" + sub_dir
process_tree(sub_tree_dir, False)
process_tree("../src", False)
process_tree("../external", True)

# generate vcxproj

# list of locations in the build directory where headers show up
# this might change over time...

build_output_search_paths = [ sub_dir ]
build_output_search_paths = [ "../src" ]

def build_search_path(build_dir):
# list of build directory paths with headers in them
Expand Down Expand Up @@ -110,7 +109,7 @@ def build_search_path(build_dir):
project_template = Template(open("bridge-remix.vcxproj.template", "rt").read())

data = project_template.safe_substitute(
bridge_remix_project_guid=generate_guid(project_base_name),
bridge_remix_project_guid=generate_guid(bridge_project_name),
bridge_cpp_defines=bridge_cpp_defines,
include_search_path_debug_32=include_search_path_debug_32,
include_search_path_debug_64=include_search_path_debug_64,
Expand All @@ -120,7 +119,7 @@ def build_search_path(build_dir):
include_search_path_release_64=include_search_path_release_64,
file_references=file_references)

project_name = project_base_name + ".vcxproj"
project_name = bridge_project_name + ".vcxproj"
write_file_if_not_identical(output_root_path, project_name, data)

# generate vcxproj.filters
Expand Down Expand Up @@ -155,6 +154,6 @@ def build_search_path(build_dir):
references += reference_template.safe_substitute(path=fileref, filter_name=filter_name)

data = filters_file_template.safe_substitute(filters=filters, file_references=references)
project_filter_name = project_base_name + ".vcxproj.filters"
project_filter_name = bridge_project_name + ".vcxproj.filters"
if write_file_if_not_identical(output_root_path, project_filter_name, data):
print("Generated " + project_filter_name)
5 changes: 1 addition & 4 deletions vsgen/generate_vs_project_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,5 @@
generate_testcase_project(vcxproj_output_dir, project, commandline, output_dir, working_dir)
test_case_projects.append(project)

generate_bridge_project(vcxproj_output_dir, bridge_cpp_defines, client_project_name, "src/client")
generate_bridge_project(vcxproj_output_dir, bridge_cpp_defines, util_project_name, "src/util")
generate_bridge_project(vcxproj_output_dir, bridge_cpp_defines, server_project_name, "src/server")
generate_bridge_project(vcxproj_output_dir, bridge_cpp_defines, launcher_project_name, "src/launcher")
generate_bridge_project(vcxproj_output_dir, bridge_cpp_defines)
generate_sln(vcxproj_output_dir, test_case_projects)
41 changes: 7 additions & 34 deletions vsgen/sln.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,13 @@
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{$nmake_project_type_guid}") = "$client_project_name", "${client_project_name}.vcxproj", "{$client_project_guid}"
EndProject
Project("{$nmake_project_type_guid}") = "$util_project_name", "${util_project_name}.vcxproj", "{$util_project_guid}"
EndProject
Project("{$nmake_project_type_guid}") = "$server_project_name", "${server_project_name}.vcxproj", "{$server_project_guid}"
EndProject
Project("{$nmake_project_type_guid}") = "$launcher_project_name", "${launcher_project_name}.vcxproj", "{$launcher_project_guid}"
Project("{$nmake_project_type_guid}") = "$bridge_project_name", "${bridge_project_name}.vcxproj", "{$bridge_project_guid}"
EndProject
""")

test_project_template = Template("""Project("{$nmake_project_type_guid}") = "$project_name", "$project_file_name.vcxproj", "{$project_guid}"
ProjectSection(ProjectDependencies) = postProject
{$client_project_guid} = {$client_project_guid}
{$util_project_guid} = {$util_project_guid}
{$server_project_guid} = {$server_project_guid}
{$launcher_project_guid} = {$launcher_project_guid}
{$bridge_project_guid} = {$bridge_project_guid}
EndProjectSection
EndProject
""")
Expand Down Expand Up @@ -109,10 +100,7 @@

def generate_sln(output_root_path, test_cases):
solution_guid = generate_guid(output_file)
client_project_guid = generate_guid(client_project_name)
util_project_guid = generate_guid(util_project_name)
server_project_guid = generate_guid(server_project_name)
launcher_project_guid = generate_guid(launcher_project_name)
bridge_project_guid = generate_guid(bridge_project_name)

# list of tuples (project_name, project_guid, folder_guid)
projects = []
Expand All @@ -130,25 +118,16 @@ def generate_sln(output_root_path, test_cases):

output_data = header_template.safe_substitute(
nmake_project_type_guid=nmake_project_type_guid,
client_project_name=client_project_name,
util_project_name=util_project_name,
server_project_name=server_project_name,
launcher_project_name=launcher_project_name,
client_project_guid=client_project_guid,
util_project_guid=util_project_guid,
server_project_guid = server_project_guid,
launcher_project_guid = launcher_project_guid)
bridge_project_name=bridge_project_name,
bridge_project_guid=bridge_project_guid)

for project_name, project_file_name, project_guid, folder_guid in projects:
output_data += test_project_template.safe_substitute(
nmake_project_type_guid=nmake_project_type_guid,
project_name=project_name,
project_file_name=project_file_name,
project_guid=project_guid,
client_project_guid=client_project_guid,
util_project_guid=util_project_guid,
server_project_guid = server_project_guid,
launcher_project_guid = launcher_project_guid)
bridge_project_guid=bridge_project_guid)

for folder_name in folders:
folder_guid = generate_guid(folder_name)
Expand All @@ -160,13 +139,7 @@ def generate_sln(output_root_path, test_cases):
output_data += global_header

output_data += global_project_section_template.safe_substitute(
project_guid=client_project_guid)
output_data += global_project_section_template.safe_substitute(
project_guid=util_project_guid)
output_data += global_project_section_template.safe_substitute(
project_guid=server_project_guid)
output_data += global_project_section_template.safe_substitute(
project_guid=launcher_project_guid)
project_guid=bridge_project_guid)

for project_name, project_file_name, project_guid, folder_guid in projects:
output_data += global_project_section_template.safe_substitute(
Expand Down
8 changes: 2 additions & 6 deletions vsgen/testcase_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@ def generate_testcase_project(vcxproj_output_path, test_case, command_line, outp
copy_target=copy_target,
copy_target_server=copy_target_server,
copy_target_launcher=copy_target_launcher,
client_project_name=client_project_name,
server_project_name=server_project_name,
launcher_project_name=launcher_project_name,
client_project_guid = generate_guid(client_project_name),
server_project_guid = generate_guid(server_project_name),
launcher_project_guid = generate_guid(launcher_project_name))
bridge_project_name=bridge_project_name,
bridge_project_guid = generate_guid(bridge_project_name))

write_file_if_not_identical(vcxproj_output_path, vcxproj_target, d)

Expand Down
10 changes: 2 additions & 8 deletions vsgen/testcase_project.vcxproj.template
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,8 @@
<ItemGroup>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="${client_project_name}.vcxproj">
<Project>{$client_project_guid}</Project>
</ProjectReference>
<ProjectReference Include="${server_project_name}.vcxproj">
<Project>{$server_project_guid}</Project>
</ProjectReference>
<ProjectReference Include="${launcher_project_name}.vcxproj">
<Project>{$launcher_project_guid}</Project>
<ProjectReference Include="${bridge_project_name}.vcxproj">
<Project>{$bridge_project_guid}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
5 changes: 1 addition & 4 deletions vsgen/vsutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
import difflib
import configparser

client_project_name = "bridge-remix-client"
util_project_name = "bridge-remix-util"
server_project_name = "bridge-remix-server"
launcher_project_name = "bridge-remix-launcher"
bridge_project_name = "bridge-remix"

def generate_guid(key):
return str(uuid.uuid5(uuid.NAMESPACE_DNS, key)).upper()
Expand Down

0 comments on commit 611fac1

Please sign in to comment.