1
0

fixed visual studio compile flags

This commit is contained in:
tycho 2013-12-19 15:29:23 +00:00
parent 7d096c41f7
commit 0c027927c4

View File

@ -3,9 +3,14 @@ cmake_minimum_required (VERSION 2.6)
project (MCServer) project (MCServer)
set(CMAKE_CXX_FLAGS_BAK ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS_BAK ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
set(CMAKE_C_FLAGS_BAK ${CMAKE_C_FLAGS}) set(CMAKE_C_FLAGS_BAK ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
endif()
set(CMAKE_BUILD_TYPE_BAK ${CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE_BAK ${CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
@ -21,8 +26,13 @@ add_subdirectory(lib/luaexpat/)
add_subdirectory(lib/md5/) add_subdirectory(lib/md5/)
#TODo: set -Wall -Werror -Wextra #TODo: set -Wall -Werror -Wextra
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK}") if(UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BAK}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK} -Wall -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BAK} -Wall -Wextra")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK} /Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BAK} /Wall")
endif()
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_BAK}") set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_BAK}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")