widberg / bgfx.cmake

https://github.com/bkaradzic/bgfx.cmake. Independently maintained CMake build scripts for bgfx. Released under public domain.
https://github.com/bkaradzic/bgfx.cmake
Creative Commons Zero v1.0 Universal
286 stars 254 forks source link

Amalgamated builds cause linking errors with tools. #6

Closed thedmd closed 7 years ago

thedmd commented 7 years ago

Tools use CMake interface library to include some files from bgfx sources. When using amalgamated build these sources are marked as headers and therefore not complied nor linked.

This can be solved by createing cpp file in binary directory that include necessary file there.

Changing header only flag to false in tool cmake file may not work due to how cmake works.

Thanks for your work. : )

JoshuaBrookover commented 7 years ago

You're right. That's a weird case. Neat idea with the cpp file, let me think on it a bit.

JoshuaBrookover commented 7 years ago

I fixed this using the approach you suggested. Thank you!

https://github.com/JoshuaBrookover/bgfx.cmake/commit/87759f1c11daf024bfb97ee4c46e062371ebc04d