diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bf3a8d8c..a699f2741 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -398,7 +398,7 @@ if(MSVC OR MINGW) endif() if(MINGW) - find_library(LIBGCC NAMES "libgcc_s_dw2-1.dll" "libgcc_s_sjlj-1.dll" PATHS ${CMAKE_FIND_ROOT_PATH}) + find_library(LIBGCC NAMES "libgcc_s_dw2-1.dll" "libgcc_s_sjlj-1.dll" "libgcc_s_seh-1.dll" PATHS ${CMAKE_FIND_ROOT_PATH}) if(LIBGCC) file(COPY ${LIBGCC} DESTINATION ${CMAKE_BINARY_DIR}/bin/) endif() diff --git a/cmake/Toolchain-mingw-64bit.cmake b/cmake/Toolchain-mingw-64bit.cmake new file mode 100644 index 000000000..048acad55 --- /dev/null +++ b/cmake/Toolchain-mingw-64bit.cmake @@ -0,0 +1,20 @@ +# Usage: +# cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw-64bit.cmake + +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix) +SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix) +SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/4.9-posix ${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 ALWAYS) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/Toolchain-mingw.cmake b/cmake/Toolchain-mingw.cmake index 56908e12e..9d3337d56 100644 --- a/cmake/Toolchain-mingw.cmake +++ b/cmake/Toolchain-mingw.cmake @@ -1,3 +1,6 @@ +# Usage: +# cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw.cmake + # the name of the target operating system SET(CMAKE_SYSTEM_NAME Windows) diff --git a/src/scriptengine/scriptstdstring.hpp b/src/scriptengine/scriptstdstring.hpp index 11181a0fb..d7e3a49c6 100644 --- a/src/scriptengine/scriptstdstring.hpp +++ b/src/scriptengine/scriptstdstring.hpp @@ -11,13 +11,15 @@ #ifndef SCRIPTSTDSTRING_H #define SCRIPTSTDSTRING_H +// String must be included before angelscript.h to avoid some errors during +// compilation with GetObject function +#include + #ifndef ANGELSCRIPT_H // Avoid having to inform include path if header is already include before #include #endif -#include - //--------------------------- // Compilation settings //