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

CXX_STANDARD 11 does not compile #31

Closed tjysdsg closed 5 years ago

tjysdsg commented 5 years ago

Compilng on Ubuntu 18.04 LTS, with cmake minimum version 3.0, The body of constexpr function not a return-statement

After changing CMakeLists.txt in the bgfx.cmake root directory to this:

if (APPLE)
    set(CMAKE_CXX_FLAGS "-ObjC++ --std=c++14")
elseif (UNIX)
    set(CMAKE_CXX_STANDARD 14)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif ()

It compiles and runs great!

TheComet commented 5 years ago

Can confirm, this fixes compiling the newest versions of bgfx, bx, and bimg on linux.

JoshuaBrookover commented 5 years ago

If you can make a PR I'll merge it in, otherwise I will have this fixed after the holidays here in the US. Thanks!

JoshuaBrookover commented 5 years ago

Merged PR. Thanks so much!