CMake Xcode Generator fix (#5771)

Removed the generator expression from the `LY_ARCHIVE_FILE_SEARCH_MODE` define as Xcode doesn't support per-config per-file definitions.

Updated the #else block in ArchiveVars to default to PakOnly mode if the `LY_ARCHIVE_FILE_SEARCH_MODE` define isn't set.

Moved the the `LY_ARCHIVE_FILE_SEARCH_MODE` Cache Variable from cmake/Deployment.cmake to feature_options.cmake within the AzFramework folder.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
lumberyard-employee-dm
2021-11-19 11:23:38 -06:00
committed by GitHub
parent 9e076db1fe
commit b0dc1ea6fa
5 changed files with 22 additions and 9 deletions
@@ -13,10 +13,12 @@ namespace AZ::IO
{
FileSearchPriority GetDefaultFileSearchPriority()
{
#if defined(LY_ARCHIVE_FILE_SEARCH_MODE_DEFAULT)
return FileSearchPriority{ LY_ARCHIVE_FILE_SEARCH_MODE_DEFAULT };
#if defined(LY_ARCHIVE_FILE_SEARCH_MODE)
return FileSearchPriority{ LY_ARCHIVE_FILE_SEARCH_MODE };
#else
return FileSearchPriority{};
return FileSearchPriority{ !ArchiveVars::IsReleaseConfig
? FileSearchPriority::FileFirst
: FileSearchPriority::PakOnly };
#endif
}
}
@@ -79,6 +79,7 @@ set(FILES
CommandLine/CommandLine.h
CommandLine/CommandRegistrationBus.h
Debug/DebugCameraBus.h
feature_options.cmake
Viewport/ViewportBus.h
Viewport/ViewportBus.cpp
Viewport/ViewportColors.h
@@ -0,0 +1,13 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
set(LY_ARCHIVE_FILE_SEARCH_MODE "" CACHE STRING "Set the default file search mode to locate non-Pak files within the Archive System\n\
Valid values are:\n\
0 = Search FileSystem first, before searching within mounted Paks (default in debug/profile)\n\
1 = Search mounted Paks first, before searching FileSystem\n\
2 = Search only mounted Paks (default in release)\n")