Fix build on CMake 2.8, and fix Web build

And suppress some warnings that are too verbose in Web builds.
This commit is contained in:
Kai Ninomiya 2020-03-23 12:26:53 -07:00
parent 1f0fcbe5a3
commit 16bb8881e6
4 changed files with 20 additions and 13 deletions

View file

@ -142,7 +142,10 @@ if(ENABLE_GLSLANG_JS)
add_compile_options(/Os /GR-)
else()
add_compile_options(-Os -fno-exceptions)
add_link_options(-Os)
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
add_compile_options(-Wno-unused-parameter)
add_compile_options(-Wno-unused-variable -Wno-unused-const-variable)
endif()
endif()
endif(ENABLE_GLSLANG_JS)
@ -150,7 +153,7 @@ endif(ENABLE_GLSLANG_JS)
if(${CMAKE_VERSION} VERSION_LESS 3.1)
# CMake versions before 3.1 do not understand CMAKE_CXX_STANDARD
# remove this block once CMake >=3.1 has fixated in the ecosystem
add_compile_options(-std=c++11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)