From c3ea6f4ddb4aeed9663b5039e9ab11a7fef7c395 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Mon, 1 Aug 2016 15:13:35 -0600 Subject: Add mingw compile support --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 26dec8f86..56503f1ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) if (NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + + if (MINGW) + add_definitions(-DMINGW_HAS_SECURE_API) + if (MINGW_STATIC_BUILD) + add_definitions(-DQT_STATICPLUGIN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + endif() + endif() else() # Silence "deprecation" warnings add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS) @@ -175,7 +184,7 @@ IF (APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") ELSEIF(MINGW) # PSAPI is the Process Status API - set(PLATFORM_LIBRARIES winmm ws2_32 psapi) + set(PLATFORM_LIBRARIES winmm ws2_32 psapi imm32 version) # WSAPoll functionality doesn't exist before WinNT 6.x (Vista and up) add_definitions(-D_WIN32_WINNT=0x0600) -- cgit v1.2.3