diff --git a/cmake/Toolchain-mingw.cmake b/cmake/Toolchain-mingw.cmake new file mode 100644 index 000000000..1ecb47ac2 --- /dev/null +++ b/cmake/Toolchain-mingw.cmake @@ -0,0 +1,17 @@ +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix) +SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix) +SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 ${PROJECT_SOURCE_DIR}/dependencies) + +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) \ No newline at end of file diff --git a/lib/enet/CMakeLists.txt b/lib/enet/CMakeLists.txt index 719d2b9ea..fd1a0dd22 100644 --- a/lib/enet/CMakeLists.txt +++ b/lib/enet/CMakeLists.txt @@ -22,7 +22,7 @@ add_library(enet STATIC ) if(MINGW) - target_link_libraries(enet wsock32 ws2_32 Winmm) + target_link_libraries(enet wsock32 ws2_32 winmm) endif() #if(WIN32) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 05a9085d0..bb91bff0e 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -82,7 +82,7 @@ using namespace irr; #ifdef WIN32 -#include +#include #endif #if defined(__linux__) && !defined(ANDROID) #include diff --git a/src/io/file_manager.cpp b/src/io/file_manager.cpp index d60c633a9..df6310702 100644 --- a/src/io/file_manager.cpp +++ b/src/io/file_manager.cpp @@ -38,11 +38,11 @@ #include #include -namespace irr { - namespace io - { - IFileSystem* createFileSystem(); - } +namespace irr { + namespace io + { + IFileSystem* createFileSystem(); + } } // For mkdir @@ -53,7 +53,7 @@ namespace irr { # include #else # include -# include +# include # include # if !defined(__CYGWIN__ ) && !defined(__MINGW32__) /*Needed by the remove directory function */ diff --git a/src/network/stk_host.cpp b/src/network/stk_host.cpp index 081fbcc73..74e8d434f 100644 --- a/src/network/stk_host.cpp +++ b/src/network/stk_host.cpp @@ -26,7 +26,7 @@ #include #if defined(WIN32) -# include "Ws2tcpip.h" +# include "ws2tcpip.h" # define inet_ntop InetNtop #else # include