Skip to content

Commit

Permalink
yojimbo: fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Mar 2, 2024
1 parent e57d30c commit e1d114e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions recipes/yojimbo/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ def generate(self):
tc.generate()

def _patch_sources(self):
# Before building we need to make some edits to the premake file to build using conan dependencies rather than local/bundled
# Inject Conan dependencies into premake5.lua
premake_path = os.path.join(self.source_folder, "premake5.lua")
deps = list(reversed(self.dependencies.host.topological_sort.values()))
includedirs = ', '.join(f'"{p}"'.replace("\\", "/") for dep in deps for p in dep.cpp_info.aggregated_components().includedirs)
libdirs = ', '.join(f'"{p}"'.replace("\\", "/") for dep in deps for p in dep.cpp_info.aggregated_components().libdirs)
if self.settings.os != "Windows":
includedirs += ', "netcode.io", "reliable.io"'
replace_in_file(self, premake_path, 'includedirs { ', 'includedirs { ".", ' + includedirs + ' } --')
replace_in_file(self, premake_path, 'libdirs { "', 'libdirs { ' + libdirs + '} --')
replace_in_file(self, premake_path, 'includedirs { ', 'includedirs { ' + includedirs + ', ')
replace_in_file(self, premake_path, 'libdirs { ', 'libdirs { ' + libdirs + ', ')
replace_in_file(self, premake_path, ', "/usr/local/include"', "")
if self.settings.os == "Windows":
replace_in_file(self, premake_path, '"sodium"', '"libsodium"')

Expand Down

0 comments on commit e1d114e

Please sign in to comment.