|
|
|
@ -30,7 +30,7 @@ endforeach()
|
|
|
|
# \arg:restricted returns the restricted association element from an o3de json, otherwise engine 'o3de' is assumed
|
|
|
|
# \arg:restricted returns the restricted association element from an o3de json, otherwise engine 'o3de' is assumed
|
|
|
|
# \arg:o3de_json_file name of the o3de json file
|
|
|
|
# \arg:o3de_json_file name of the o3de json file
|
|
|
|
function(o3de_restricted_id o3de_json_file restricted)
|
|
|
|
function(o3de_restricted_id o3de_json_file restricted)
|
|
|
|
file(READ ${o3de_json_file} json_data)
|
|
|
|
ly_file_read(${o3de_json_file} json_data)
|
|
|
|
string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted_name")
|
|
|
|
string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted_name")
|
|
|
|
if(json_error)
|
|
|
|
if(json_error)
|
|
|
|
message(WARNING "Unable to read restricted from '${o3de_json_file}', error: ${json_error}")
|
|
|
|
message(WARNING "Unable to read restricted from '${o3de_json_file}', error: ${json_error}")
|
|
|
|
@ -46,7 +46,7 @@ endfunction()
|
|
|
|
# \arg:restricted_name name of the restricted
|
|
|
|
# \arg:restricted_name name of the restricted
|
|
|
|
function(o3de_find_restricted_folder restricted_name restricted_path)
|
|
|
|
function(o3de_find_restricted_folder restricted_name restricted_path)
|
|
|
|
# Read the restricted path from engine.json if one EXISTS
|
|
|
|
# Read the restricted path from engine.json if one EXISTS
|
|
|
|
file(READ ${LY_ROOT_FOLDER}/engine.json engine_json_data)
|
|
|
|
ly_file_read(${LY_ROOT_FOLDER}/engine.json engine_json_data)
|
|
|
|
string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${engine_json_data} "restricted")
|
|
|
|
string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${engine_json_data} "restricted")
|
|
|
|
if(restricted_subdirs_count GREATER 0)
|
|
|
|
if(restricted_subdirs_count GREATER 0)
|
|
|
|
string(JSON restricted_subdir ERROR_VARIABLE engine_json_error GET ${engine_json_data} "restricted" "0")
|
|
|
|
string(JSON restricted_subdir ERROR_VARIABLE engine_json_error GET ${engine_json_data} "restricted" "0")
|
|
|
|
@ -66,7 +66,7 @@ function(o3de_find_restricted_folder restricted_name restricted_path)
|
|
|
|
# Examine the o3de manifest file for the list of restricted directories
|
|
|
|
# Examine the o3de manifest file for the list of restricted directories
|
|
|
|
set(o3de_manifest_path ${home_directory}/.o3de/o3de_manifest.json)
|
|
|
|
set(o3de_manifest_path ${home_directory}/.o3de/o3de_manifest.json)
|
|
|
|
if(EXISTS ${o3de_manifest_path})
|
|
|
|
if(EXISTS ${o3de_manifest_path})
|
|
|
|
file(READ ${o3de_manifest_path} o3de_manifest_json_data)
|
|
|
|
ly_file_read(${o3de_manifest_path} o3de_manifest_json_data)
|
|
|
|
string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${o3de_manifest_json_data} "restricted")
|
|
|
|
string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${o3de_manifest_json_data} "restricted")
|
|
|
|
if(restricted_subdirs_count GREATER 0)
|
|
|
|
if(restricted_subdirs_count GREATER 0)
|
|
|
|
math(EXPR restricted_subdirs_range "${restricted_subdirs_count}-1")
|
|
|
|
math(EXPR restricted_subdirs_range "${restricted_subdirs_count}-1")
|
|
|
|
@ -79,7 +79,7 @@ function(o3de_find_restricted_folder restricted_name restricted_path)
|
|
|
|
# Iterate over the restricted directories from the manifest file
|
|
|
|
# Iterate over the restricted directories from the manifest file
|
|
|
|
foreach(restricted_entry ${restricted_subdirs})
|
|
|
|
foreach(restricted_entry ${restricted_subdirs})
|
|
|
|
set(restricted_json_file ${restricted_entry}/restricted.json)
|
|
|
|
set(restricted_json_file ${restricted_entry}/restricted.json)
|
|
|
|
file(READ ${restricted_json_file} restricted_json)
|
|
|
|
ly_file_read(${restricted_json_file} restricted_json)
|
|
|
|
string(JSON this_restricted_name ERROR_VARIABLE json_error GET ${restricted_json} "restricted_name")
|
|
|
|
string(JSON this_restricted_name ERROR_VARIABLE json_error GET ${restricted_json} "restricted_name")
|
|
|
|
if(json_error)
|
|
|
|
if(json_error)
|
|
|
|
message(WARNING "Unable to read restricted_name from '${restricted_json_file}', error: ${json_error}")
|
|
|
|
message(WARNING "Unable to read restricted_name from '${restricted_json_file}', error: ${json_error}")
|
|
|
|
|