Win64 fix: if you disable enough things in CMakeList.txt blender compiles on win64...
authorDaniel Genrich <daniel.genrich@gmx.net>
Sun, 13 Jul 2008 18:29:07 +0000 (18:29 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Sun, 13 Jul 2008 18:29:07 +0000 (18:29 +0000)
CMakeLists.txt
intern/bsp/intern/BSP_CSGMesh.cpp
intern/container/CTR_TaggedIndex.h
intern/decimation/intern/LOD_ManMesh2.cpp

index b58fe9456639abdd060aa9f9f6812e3083a54bbb..5a23e77d9f81fa04100e840f1bab164e442a317f 100644 (file)
@@ -197,10 +197,17 @@ IF(UNIX)
 ENDIF(UNIX)
 
 IF(WIN32)
-  INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
 
+  INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
+  
   SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
 
+  # Setup 64bit and 64bit windows systems
+  IF(CMAKE_CL_64)
+    message("64 bit compiler detected.")
+    SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
+  ENDIF(CMAKE_CL_64)
+
   SET(PYTHON ${LIBDIR}/python)
   SET(PYTHON_VERSION 2.5)
   SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
@@ -214,12 +221,20 @@ IF(WIN32)
   SET(OPENAL_LIB openal_static)
   SET(OPENAL_LIBPATH ${OPENAL}/lib)
 
-  SET(PNG_LIB libpng_st)
+  IF(CMAKE_CL_64)
+       SET(PNG_LIB libpng)
+  ELSE(CMAKE_CL_64)
+       SET(PNG_LIB libpng_st)
+  ENDIF(CMAKE_CL_64)
   SET(JPEG_LIB libjpeg)
 
   SET(ZLIB ${LIBDIR}/zlib)
   SET(ZLIB_INC ${ZLIB}/include)
-  SET(ZLIB_LIB libz)
+  IF(CMAKE_CL_64)
+       SET(ZLIB_LIB zlib)
+  ELSE(CMAKE_CL_64)
+       SET(ZLIB_LIB libz)
+  ENDIF(CMAKE_CL_64)
   SET(ZLIB_LIBPATH ${ZLIB}/lib)
   
   SET(PTHREADS ${LIBDIR}/pthreads)
@@ -302,7 +317,11 @@ IF(WIN32)
   
   SET(WINTAB_INC ${LIBDIR}/wintab/include) 
 
-  SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib")
+  IF(CMAKE_CL_64)
+  SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib;MSVCRT.lib ")
+  ELSE(CMAKE_CL_64)
+  SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
+  ENDIF(CMAKE_CL_64)
   SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
 ENDIF(WIN32)
 
index 553f39a4642e1a8ae73c3f1f5baeecf51d3fbc10..ca7795b3cf5edea6b29dfa9caab4fd1e6accf674 100644 (file)
@@ -197,7 +197,7 @@ BuildEdges(
 
                for (int vert = 0; vert < vertex_num; ++vert) {
 
-                       BSP_FaceInd fi(f_it - f_it_begin);
+                       BSP_FaceInd fi(size_t (f_it - f_it_begin));
                        InsertEdge(prev_vi,face.m_verts[vert],fi,dummy);
                        prev_vi = face.m_verts[vert];
                }
index 7a7bd85e8902d02347f067f1080babe2548ebef5..68d2536c8793fb37d526295a0ac6d7aa0562cc36 100644 (file)
@@ -93,6 +93,16 @@ public:
        }
 
 
+#if defined(_WIN64)
+       CTR_TaggedIndex(
+               const unsigned __int64 val
+       ) :
+               m_val ( ((unsigned __int64)val & index_mask)
+                               | ( (empty_tag << tag_shift)
+                                       & (~index_mask) ) ) {
+       }
+#endif
+
        CTR_TaggedIndex(
                const CTR_TaggedIndex &my_index
        ):
@@ -124,6 +134,12 @@ public:
                return (long int)(m_val & index_mask);
        }
 
+#if defined(_WIN64)
+       operator unsigned __int64 () const {
+                       return (unsigned __int64)(m_val & index_mask);
+               }
+#endif
+
                bool
        IsEmpty(
        ) const {
index eeb497bb09eb1024a003b0ac6fb135d3046de0ce..2fe49b36583c47c756fa1dd498d08908fd7ccb3e 100644 (file)
@@ -477,7 +477,7 @@ DeleteVertex(
                return;
        }
 
-       LOD_VertexInd last = LOD_VertexInd(verts.end() - verts.begin() - 1);
+       LOD_VertexInd last = LOD_VertexInd(size_t(verts.end() - verts.begin() - 1));
 
        if (!(last == v)) {
 
@@ -533,7 +533,7 @@ DeleteEdge(
                return;
        }
 
-       LOD_EdgeInd last = LOD_EdgeInd(edges.end() - edges.begin() - 1);
+       LOD_EdgeInd last = LOD_EdgeInd(size_t(edges.end() - edges.begin() - 1));
 
        if (!(last == e)) {
                vector<LOD_EdgeInd> e_verts;
@@ -573,7 +573,7 @@ DeleteFace(
                return;
        }
 
-       LOD_FaceInd last = LOD_FaceInd(faces.end() - faces.begin() - 1);
+       LOD_FaceInd last = LOD_FaceInd(size_t (faces.end() - faces.begin() - 1));
 
        if (!(last == f)) {