From 83aff2d68e67b9f18ad81c6c31294118d0860318 Mon Sep 17 00:00:00 2001 From: Michael Pavlyshko Date: Sat, 12 Jul 2014 14:10:44 +0300 Subject: [PATCH] * remove static linking for libgcc * fix clang warnings --- CMakeLists.txt | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db872cdeb..7ef744909 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,18 +70,12 @@ if (WIN32) set(CMAKE_SHARED_LIBRARY_PREFIX "") if(MINGW) - get_filename_component(MINGW_PATH ${CMAKE_CXX_COMPILER} PATH ) - - #link to libgcc_s_*.dll statically - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") - - #copy libwinpthread-*.dll to VCMI location - set(dep_files ${dep_files} "${MINGW_PATH}/libwinpthread-*.dll") - - #copy libgcc_s_*.dll and libstdc++-*.dll to VCMI location, because vanilla Qt5 build with dynamic linking - set(dep_files ${dep_files} "${MINGW_PATH}/libgcc_s_*.dll") - set(dep_files ${dep_files} "${MINGW_PATH}/libstdc++-*.dll") + get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH ) + + #copy libwinpthread-*.dll, libgcc_s_*.dll and libstdc++-*.dll to VCMI location + set(dep_files ${dep_files} "${MINGW_BIN_PATH}/libwinpthread-*.dll") + set(dep_files ${dep_files} "${MINGW_BIN_PATH}/libgcc_s_*.dll") + set(dep_files ${dep_files} "${MINGW_BIN_PATH}/libstdc++-*.dll") endif() endif() @@ -144,7 +138,7 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX OR NOT WIN32) #so far all *nix compilers support such parameters if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CLANG_SPECIFIC_FLAGS "-Wno-mismatched-tags") + set(CLANG_SPECIFIC_FLAGS "-Wno-mismatched-tags -Wno-unknown-warning-option") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -Wpointer-arith -Wno-strict-aliasing -Wno-switch -Wno-sign-compare -Wno-unused-local-typedefs -Wno-unused-parameter -Wuninitialized -Wno-overloaded-virtual -Wno-type-limits ${CLANG_SPECIFIC_FLAGS}")