]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Add specific platform definitions for Windows 64 bit platform
authorana <ana@opencascade.com>
Tue, 23 Oct 2012 15:37:22 +0000 (15:37 +0000)
committerana <ana@opencascade.com>
Tue, 23 Oct 2012 15:37:22 +0000 (15:37 +0000)
salome_adm/cmake_files/FindPLATFORM.cmake

index 9266320ac7d263f49e2d8f0b97d9cf0ef35711af..c4dea837f998f3c563b70e7f3ba7e0298e2ea9ea 100644 (file)
@@ -107,6 +107,10 @@ IF(WINDOWS)
   SET(PLATFORM_LIBS ${PLATFORM_LIBS} Ws2_32.lib)
   SET(PLATFORM_LIBS ${PLATFORM_LIBS} Userenv.lib) # At least for GEOM suit
 
+  IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")          # if platform is Windows 64 bit 
+    SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0 -D_HAS_ITERATOR_DEBUGGING=0") # To avoid runtime error during checking iterators  # to be removed
+    SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0 -D_HAS_ITERATOR_DEBUGGING=0") # To avoid runtime error during checking iterators 
+  ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
 ELSE(WINDOWS)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wparentheses)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wreturn-type)
@@ -117,8 +121,13 @@ ELSE(WINDOWS)
   SET(PLATFORM_LIBS ${PLATFORM_LIBS} -ldl)
 ENDIF(WINDOWS)
 
-SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4") # to be removed
-SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4")
+SET(SIZE_OF_LONG ${CMAKE_SIZEOF_VOID_P})            # set sizeof(long) the same as size of pointers, because on all memory models (EXCLUDING WINDOWS 64 bit) it is equivalent values
+IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8"  AND WINDOWS) # if it platform Windows 64 bit
+  SET((SIZE_OF_LONG "4")                            # set sizeof(long) to 4 byte
+ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8"  AND WINDOWS)
+
+SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${SIZE_OF_LONG} -DSIZEOF_INT=4") # to be removed
+SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${SIZE_OF_LONG} -DSIZEOF_INT=4")
 
 SET(COMPILATION_WITH_CMAKE ON)