Use CMake-provided C/C++ standard selection capabilities; fix build (qtr.pro)

This commit is contained in:
Mike Gelfand 2015-08-01 16:05:02 +00:00
parent fd9c2c74f4
commit 0f9bdc6ac2
3 changed files with 13 additions and 4 deletions

View File

@ -338,10 +338,19 @@ if(WIN32)
endforeach()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
if(CMAKE_VERSION VERSION_LESS "3.1")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
else()
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(NEEDED_COMPILER_FLAGS
-Wall
-W

View File

@ -285,7 +285,6 @@ QString
TorrentDelegate::shortStatusString (const Torrent& tor)
{
QString str;
static const QChar ratioSymbol (0x262F);
switch (tor.getActivity ())
{

View File

@ -55,6 +55,7 @@ TRANSLATIONS += translations/transmission_en.ts \
FORMS += AboutDialog.ui \
DetailsDialog.ui \
LicenseDialog.ui \
MainWindow.ui \
MakeDialog.ui \
MakeProgressDialog.ui \