Don't use -std=c++11 explicitly and update cmake version requirement.

This commit is contained in:
King_DuckZ 2016-10-31 20:47:47 +01:00
parent 7985ba2bc4
commit 19dc6759df
2 changed files with 21 additions and 17 deletions

View file

@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(CloonelJump CXX) project(CloonelJump CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include")
include(TargetArch) include(TargetArch)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pedantic -Wconversion") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wconversion")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -Wall -Wextra -pedantic -Wconversion -DWITH_DEBUG_VISUALS -O0") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -Wconversion -DWITH_DEBUG_VISUALS -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -Wall -Wextra -pedantic -Wconversion -O3") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wextra -pedantic -Wconversion -O3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
@ -133,3 +133,18 @@ if (RASPBERRY_PI)
bcm_host bcm_host
) )
endif(RASPBERRY_PI) endif(RASPBERRY_PI)
target_compile_features(${PROJECT_NAME}
PRIVATE cxx_nullptr
PRIVATE cxx_range_for
PRIVATE cxx_lambdas
PRIVATE cxx_decltype_auto
PRIVATE cxx_defaulted_functions
PRIVATE cxx_deleted_functions
PRIVATE cxx_auto_type
PRIVATE cxx_decltype_incomplete_return_types
PRIVATE cxx_defaulted_move_initializers
PRIVATE cxx_noexcept
PRIVATE cxx_rvalue_references
PRIVATE cxx_delegating_constructors
)

View file

@ -33,18 +33,8 @@ namespace cloonel {
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
Character::Character (const std::string& parPath, SDLMain* parMain, float2 parSize) : Character::Character (const std::string& parPath, SDLMain* parMain, float2 parSize) :
Placeable(float2(0.0f)), Character(std::string(parPath), parMain, parSize)
Drawable(parSize),
m_bottomBar(float2(0.0f), parSize.x()),
m_screenRatio(parMain),
m_bounceCallback(&DoNothing),
m_texture(new Texture(parPath, parMain, false))
#if defined(WITH_DEBUG_VISUALS)
, m_bottomBarDrawable(parMain, Colour(250, 5, 1), static_cast<short2>(m_bottomBar.From()), static_cast<short2>(m_bottomBar.To()))
#endif
{ {
assert(parMain);
m_bottomBar.SetCallback(std::bind(&Character::OnBounce, this, std::placeholders::_1, std::placeholders::_2));
} }
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
@ -66,8 +56,7 @@ namespace cloonel {
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
Character::~Character() noexcept { Character::~Character() noexcept = default;
}
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------
///------------------------------------------------------------------------- ///-------------------------------------------------------------------------