diff --git a/CMakeLists.txt b/CMakeLists.txt index 84fb13c..ea152ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,6 +113,7 @@ if(APPLE AND NOT BOOST_ROOT) execute_process(COMMAND brew --prefix boost OUTPUT_VARIABLE BOOST_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE) endif() if(MINGW) + set(MINGW_FLAG "${MINGW_FLAG} -DWIN32_LEAN_AND_MEAN") set(Boost_THREADAPI win32) endif() @@ -275,8 +276,8 @@ endif() add_c_flag_if_supported(-fPIC C_SECURITY_FLAGS) add_cxx_flag_if_supported(-fPIC CXX_SECURITY_FLAGS) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${C_SECURITY_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_SECURITY_FLAGS}") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MINGW_FLAG} -std=c11 ${C_SECURITY_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MINGW_FLAG} ${CXX_SECURITY_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}") add_subdirectory(src)