Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed CMake configuration issue for Gems (o3de#18628)
that use CMake to compile external 3rdparty libraries when those libraries, like FlatBuffers, define custom target that rely on CMake generator rules. For example I have a Gem that relies on a proprietary library called `myproj`. In turn, `myproj` requires FlatBuffers and uses the CMake function from FlatBuffers called: ``` build_flatbuffers ``` Which define custom targets to automatically compile the IDL files whenever there are change and generate new C++ files. I was getting this error when running CMake configure: ``` -- Configuring done (56.5s) CMake Error at C:/GIT/o3de/cmake/LYWrappers.cmake:398 (add_custom_command): Error evaluating generator expression: $<TARGET_FILE:myproj_schema> Target "myproj_schema" is not an executable or library. Call Stack (most recent call first): C:/GIT/o3de/Code/LauncherUnified/launcher_generator.cmake:164 (ly_add_target) C:/GIT/o3de/Code/LauncherUnified/CMakeLists.txt:105 (include) ``` I reached out to @nick-l-o3de, and he found out that `cmake/Platform/Common/RuntimeDependencies_common.cmake` was the culprit and extra logic was needed at lines: ``` 313: if(NOT target_type IN_LIST LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS OR target_type STREQUAL UTILITY) 373: if(NOT target_type IN_LIST LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS OR target_type STREQUAL UTILITY) ``` Signed-off-by: galibzon <[email protected]>
- Loading branch information