caseymcc / UE4CMake

Provides a simple way to add a cmake lib to any Unreal Engine 4 (UE4) or 5 (UE5) project.
MIT License
85 stars 16 forks source link

On linux use unreal toolchain for cmake target #10

Closed caseymcc closed 1 year ago

caseymcc commented 1 year ago

On linux it will use the Unreal toolchain for the cmake target rather than the system compiler detected by cmake.

AndreaCatania commented 2 months ago

Hello, I'm running into a linking problem when compiling the binary for Linux from Windows using the cross compilation toolchain.

The problem is caused by the CMake libray being compiled for Windows: ld.lld: warning: C:/Users/.../NetSync.lib: archive member 'NetSync.dir\Release\AbilitiesDB.obj' is neither ET_REL nor LLVM bitcode

I wonder what should I change in my CMakeList in order to ensure it compiles using the Linux toolchain used by unreal? This is my CMakeList: https://github.com/GameNetworking/NetworkSynchronizer/blob/main/cmake/CMakeLists.txt