mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 13:01:48 +00:00
- Fixed GCC/Clang compiler errors and warnings.
This commit is contained in:
parent
b450ac5047
commit
7474be6284
4 changed files with 43 additions and 3 deletions
|
@ -1506,7 +1506,7 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
|
|||
math/tanh.c
|
||||
math/fastsin.cpp
|
||||
zzautozend.cpp
|
||||
${CMAKE_BINARY_DIR}/src/r_drawersasm.obj
|
||||
${CMAKE_BINARY_DIR}/src/${CODEGENOBJ_SOURCES}
|
||||
)
|
||||
|
||||
set_source_files_properties( ${CODEGENOBJ_SOURCES} PROPERTIES EXTERNAL_OBJECT true GENERATED true)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
cmake_minimum_required( VERSION 2.8.7 )
|
||||
|
||||
include( CheckCXXCompilerFlag )
|
||||
|
||||
include(../../precompiled_headers.cmake)
|
||||
|
||||
# Path where it looks for the LLVM compiled files on Windows
|
||||
|
@ -54,6 +56,44 @@ else()
|
|||
endforeach(buildtype)
|
||||
endif()
|
||||
|
||||
if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.5")
|
||||
set( CMAKE_C_FLAGS "-Wno-unused-result ${CMAKE_C_FLAGS}" )
|
||||
set( CMAKE_CXX_FLAGS "-Wno-unused-result ${CMAKE_CXX_FLAGS}" )
|
||||
endif()
|
||||
if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
|
||||
if( APPLE OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.6" )
|
||||
set( CMAKE_CXX_FLAGS "-Wno-inconsistent-missing-override ${CMAKE_CXX_FLAGS}" )
|
||||
endif()
|
||||
endif()
|
||||
set( CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_C_FLAGS}" )
|
||||
set( CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_CXX_FLAGS}" )
|
||||
|
||||
# Use the highest C++ standard available since VS2015 compiles with C++14
|
||||
# but we only require C++11. The recommended way to do this in CMake is to
|
||||
# probably to use target_compile_features, but I don't feel like maintaining
|
||||
# a list of features we use.
|
||||
CHECK_CXX_COMPILER_FLAG( "-std=gnu++14" CAN_DO_CPP14 )
|
||||
if ( CAN_DO_CPP14 )
|
||||
set ( CMAKE_CXX_FLAGS "-std=gnu++14 ${CMAKE_CXX_FLAGS}" )
|
||||
else ()
|
||||
CHECK_CXX_COMPILER_FLAG( "-std=gnu++1y" CAN_DO_CPP1Y )
|
||||
if ( CAN_DO_CPP1Y )
|
||||
set ( CMAKE_CXX_FLAGS "-std=gnu++1y ${CMAKE_CXX_FLAGS}" )
|
||||
else ()
|
||||
CHECK_CXX_COMPILER_FLAG( "-std=gnu++11" CAN_DO_CPP11 )
|
||||
if ( CAN_DO_CPP11 )
|
||||
set ( CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}" )
|
||||
else ()
|
||||
CHECK_CXX_COMPILER_FLAG( "-std=gnu++0x" CAN_DO_CPP0X )
|
||||
if ( CAN_DO_CPP0X )
|
||||
set ( CMAKE_CXX_FLAGS "-std=gnu++0x ${CMAKE_CXX_FLAGS}" )
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if( WIN32 )
|
||||
if( MSVC_VERSION GREATER 1399 )
|
||||
# VC 8+ adds a manifest automatically to the executable. We need to
|
||||
|
|
|
@ -42,7 +42,7 @@ class Exception : public std::exception
|
|||
{
|
||||
public:
|
||||
Exception(const std::string &message) : message(message) { }
|
||||
const char *what() const override { return message.c_str(); }
|
||||
const char *what() const noexcept override { return message.c_str(); }
|
||||
|
||||
private:
|
||||
std::string message;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "ssa_value.h"
|
||||
|
||||
SSAFunction::SSAFunction(const std::string name)
|
||||
: name(name), return_type(llvm::Type::getVoidTy(SSAScope::context())), func()
|
||||
: func(), name(name), return_type(llvm::Type::getVoidTy(SSAScope::context()))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue