If the library code is added as a subdirectory in a CMake project and then cross-compiled with MinGW on Linux, the build fails. During linking, the OpenAL32.def file is created just inside the build directory, but then it's expected to be in build/openal-soft by sed command. If one copies the OpenAL32.def file to the correct directory and runs cmake --build . again, the build process proceeds as it should.
Here's a very simple CMake script that triggers this behaviour, assuming that the library is in the openal-soft directory in the project:
If the library code is added as a subdirectory in a CMake project and then cross-compiled with MinGW on Linux, the build fails. During linking, the OpenAL32.def file is created just inside the build directory, but then it's expected to be in build/openal-soft by
sed
command. If one copies the OpenAL32.def file to the correct directory and runscmake --build .
again, the build process proceeds as it should.Here's a very simple CMake script that triggers this behaviour, assuming that the library is in the openal-soft directory in the project:
The solution to the problem would be to generate the OpenAL32.def in the correct directory when linking.
Here is the log from CMake:
Here is the minimal project: MinimalProject.zip