mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 02:40:17 +02:00
- added cmake compile warning when users uses clang as clang currently does NOT support some critical GCC settings we require.
This commit is contained in:
@@ -21,7 +21,8 @@ MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}")
|
|||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCXX "YES")
|
SET(CMAKE_COMPILER_IS_GNUCXX "YES")
|
||||||
ADD_DEFINITIONS("-Qunused-arguments -Wno-switch")
|
# ADD_DEFINITIONS("-Qunused-arguments -Wno-switch")
|
||||||
|
ADD_DEFINITIONS("-Wno-switch")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
OPTION(BUILD_MEGAGLEST_MODEL_IMPORT_EXPORT_TOOLS "Build model import/export tools" ON)
|
OPTION(BUILD_MEGAGLEST_MODEL_IMPORT_EXPORT_TOOLS "Build model import/export tools" ON)
|
||||||
@@ -98,15 +99,34 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||||||
# Default compiler flags
|
# Default compiler flags
|
||||||
#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s") ## Strip binary
|
#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s") ## Strip binary
|
||||||
|
|
||||||
|
# Common generic GNU type compiler options that work with all generic GCC compatible compilers
|
||||||
|
ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing")
|
||||||
|
|
||||||
# For gcc warning options see: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
# For gcc warning options see: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||||
IF(NOT MINGW)
|
IF(NOT MINGW)
|
||||||
# For tons of verbose warnings add: -Wall
|
# For tons of verbose warnings add: -Wall
|
||||||
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic")
|
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic")
|
||||||
ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -rdynamic")
|
# ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -rdynamic")
|
||||||
ELSE()
|
ELSE()
|
||||||
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -DUNICODE")
|
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -DUNICODE")
|
||||||
ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -DUNICODE")
|
# ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -DUNICODE")
|
||||||
|
ADD_DEFINITIONS("-DUNICODE")
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
# CLang specific Compiler Options
|
||||||
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
|
||||||
|
# GCC specific Compiler Options
|
||||||
|
ELSE()
|
||||||
|
ADD_DEFINITIONS("-frounding-math -fsignaling-nans")
|
||||||
|
|
||||||
|
# IF(NOT MINGW)
|
||||||
|
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic")
|
||||||
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic")
|
||||||
|
# ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||||
|
|
||||||
#MESSAGE(STATUS "*TEST: Checking for max SSE LEVEL [${MAX_SSE_LEVEL_DESIRED}]")
|
#MESSAGE(STATUS "*TEST: Checking for max SSE LEVEL [${MAX_SSE_LEVEL_DESIRED}]")
|
||||||
@@ -346,6 +366,13 @@ IF(EXISTS "${PROJECT_SOURCE_DIR}/data/glest_game/CMakeLists.txt")
|
|||||||
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/data/glest_game )
|
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/data/glest_game )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
#get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
||||||
|
#MESSAGE(STATUS ">>>> NOTICE Compiler definitions used: ${DirDefs}")
|
||||||
|
#MESSAGE(STATUS "END of compile defs...")
|
||||||
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SET(CPACK_GENERATOR "DEB")
|
SET(CPACK_GENERATOR "DEB")
|
||||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mark Vejvoda") #required
|
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mark Vejvoda") #required
|
||||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "
|
||||||
|
@@ -75,14 +75,28 @@ macro(special_check_for_sse _max_sse_level_desired)
|
|||||||
set(CMAKE_REQUIRED_FLAGS)
|
set(CMAKE_REQUIRED_FLAGS)
|
||||||
|
|
||||||
if(HAS_SSE3_EXTENSIONS AND (${_max_sse_level_desired} MATCHES "3"))
|
if(HAS_SSE3_EXTENSIONS AND (${_max_sse_level_desired} MATCHES "3"))
|
||||||
set(SSE_FLAGS "-msse3 -mfpmath=sse")
|
set(SSE_FLAGS "-msse3")
|
||||||
message(STATUS "Found SSE3 extensions, using flags: ${SSE_FLAGS}")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
ELSE()
|
||||||
|
set(SSE_FLAGS "${SSE_FLAGS} -mfpmath=sse")
|
||||||
|
ENDIF()
|
||||||
|
message(STATUS "Found SSE3 extensions, using flags: ${SSE_FLAGS}")
|
||||||
elseif(HAS_SSE2_EXTENSIONS AND (${_max_sse_level_desired} MATCHES "2" OR ${_max_sse_level_desired} MATCHES "3"))
|
elseif(HAS_SSE2_EXTENSIONS AND (${_max_sse_level_desired} MATCHES "2" OR ${_max_sse_level_desired} MATCHES "3"))
|
||||||
set(SSE_FLAGS "-msse2 -mfpmath=sse")
|
set(SSE_FLAGS "-msse2")
|
||||||
message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
ELSE()
|
||||||
|
set(SSE_FLAGS "${SSE_FLAGS} -mfpmath=sse")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
|
||||||
elseif(HAS_SSE_EXTENSIONS AND (${_max_sse_level_desired} MATCHES "1" OR ${_max_sse_level_desired} MATCHES "2" OR ${_max_sse_level_desired} MATCHES "3"))
|
elseif(HAS_SSE_EXTENSIONS AND (${_max_sse_level_desired} MATCHES "1" OR ${_max_sse_level_desired} MATCHES "2" OR ${_max_sse_level_desired} MATCHES "3"))
|
||||||
set(SSE_FLAGS "-msse -mfpmath=sse")
|
set(SSE_FLAGS "-msse")
|
||||||
message(STATUS "Found SSE extensions, using flags: ${SSE_FLAGS}")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
ELSE()
|
||||||
|
set(SSE_FLAGS "${SSE_FLAGS} -mfpmath=sse")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
message(STATUS "Found SSE extensions, using flags: ${SSE_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(${SSE_FLAGS})
|
add_definitions(${SSE_FLAGS})
|
||||||
|
@@ -147,6 +147,9 @@ private:
|
|||||||
public:
|
public:
|
||||||
World();
|
World();
|
||||||
~World();
|
~World();
|
||||||
|
// World & World(World &obj) {
|
||||||
|
// throw runtime_error("class World is NOT safe to assign!");
|
||||||
|
// }
|
||||||
void cleanup();
|
void cleanup();
|
||||||
void end(); //to die before selection does
|
void end(); //to die before selection does
|
||||||
void endScenario(); //to die before selection does
|
void endScenario(); //to die before selection does
|
||||||
|
Reference in New Issue
Block a user