Fix engine template issue (#6927)
* fix get_enabled_gem_cmake_file to work with "Dem" or "Code" or "Gem/Code" folder in a project fix o3de_restricted_path to make the past paramter optional Signed-off-by: byrcolin <byrcolin@amazon.com> * Fix resolution of variables in `cmake_path(COMPARE)` calls in PAL.cmake The documentation for `cmake_path(COMPARE)` states that parameters marked as [<input>](https://cmake.org/cmake/help/latest/command/cmake_path.html#conventions) are string literals. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Co-authored-by: byrcolin <byrcolin@amazon.com> Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
+18
-10
@@ -235,14 +235,22 @@ def get_enabled_gem_cmake_file(project_name: str = None,
|
||||
enable_gem_filename = "enabled_gems.cmake"
|
||||
|
||||
if platform == 'Common':
|
||||
project_code_dir = project_path / 'Gem/Code'
|
||||
if project_code_dir.is_dir():
|
||||
dependencies_file_path = project_code_dir / enable_gem_filename
|
||||
return dependencies_file_path.resolve()
|
||||
return (project_path / 'Code' / enable_gem_filename).resolve()
|
||||
possible_project_enable_gem_filename_paths = [
|
||||
pathlib.Path(project_path / 'Gem' / enable_gem_filename),
|
||||
pathlib.Path(project_path / 'Gem/Code' / enable_gem_filename),
|
||||
pathlib.Path(project_path / 'Code' / enable_gem_filename)
|
||||
]
|
||||
for possible_project_enable_gem_filename_path in possible_project_enable_gem_filename_paths:
|
||||
if possible_project_enable_gem_filename_path.is_file():
|
||||
return possible_project_enable_gem_filename_path.resolve()
|
||||
return possible_project_enable_gem_filename_paths[0].resolve()
|
||||
else:
|
||||
project_code_dir = project_path / 'Gem/Code/Platform' / platform
|
||||
if project_code_dir.is_dir():
|
||||
dependencies_file_path = project_code_dir / enable_gem_filename
|
||||
return dependencies_file_path.resolve()
|
||||
return (project_path / 'Code/Platform' / platform / enable_gem_filename).resolve()
|
||||
possible_project_platform_enable_gem_filename_paths = [
|
||||
pathlib.Path(project_path / 'Gem/Platform' / platform / enable_gem_filename),
|
||||
pathlib.Path(project_path / 'Gem/Code/Platform' / platform / enable_gem_filename),
|
||||
pathlib.Path(project_path / 'Code/Platform' / platform / enable_gem_filename)
|
||||
]
|
||||
for possible_project_platform_enable_gem_filename_path in possible_project_platform_enable_gem_filename_paths:
|
||||
if possible_project_platform_enable_gem_filename_path.is_file():
|
||||
return possible_project_platform_enable_gem_filename_path.resolve()
|
||||
return possible_project_platform_enable_gem_filename_paths[0].resolve()
|
||||
|
||||
Reference in New Issue
Block a user