Skip to content

Commit f77a6a7

Browse files
MinGW Compatibility
TODO: Change commit hashes of external projects after merge
1 parent b142aad commit f77a6a7

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CMake/Common.cmake

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(USE_OpenMP)
2929
endif()
3030
endif()
3131

32-
if (WIN32)
32+
if (MSVC)
3333
set(CMAKE_USE_RELATIVE_PATHS "1")
3434
# Set compiler flags
3535
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP /bigobj")
@@ -38,15 +38,18 @@ if (WIN32)
3838
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
3939
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
4040
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
41-
endif (WIN32)
41+
endif (MSVC)
4242

43-
if (UNIX)
43+
if (UNIX OR MINGW)
4444
set(CMAKE_USE_RELATIVE_PATHS "1")
4545
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
4646
# Set compiler flags for "release"
4747
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -march=native")
4848
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -DNDEBUG -march=native")
49-
endif (UNIX)
49+
endif (UNIX OR MINGW)
50+
if(MINGW)
51+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O1 -Wa,-mbig-obj")
52+
endif(MINGW)
5053

5154
if(APPLE)
5255
set(CMAKE_MACOSX_RPATH 1)

Utils/IndexedFaceMesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace Utilities
3939
{
4040
m_numFaces = other.m_numFaces;
4141
m_fIndices = new unsigned int[m_numFaces];
42-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64)
42+
#if defined(_MSC_VER)
4343
std::copy(other.m_fIndices, other.m_fIndices + m_numFaces,
4444
stdext::unchecked_array_iterator<unsigned int*>(m_fIndices));
4545
#else

0 commit comments

Comments
 (0)