0024002: Overall code and build procedure refactoring -- Mac OSX
authorabv <abv@opencascade.com>
Fri, 17 Jul 2015 08:43:33 +0000 (11:43 +0300)
committerabv <abv@opencascade.com>
Fri, 17 Jul 2015 08:44:53 +0000 (11:44 +0300)
Draw_Window_1.mm, Cocoa_Window.mm - fix compilation issues on OS X
CMake env.build.sh - fix libraries path

MSVC project templates - /bigobj flag added for all configurations (x64, x86, release and debug)

Standard_Type.hxx - enforce initialization of all type descriptors at library load

adm/templates/env.build.sh.in
adm/templates/template.vc10
adm/templates/template.vc11
adm/templates/template.vc12
adm/templates/template.vc9
src/Cocoa/Cocoa_Window.mm
src/Draw/Draw_Window_1.mm
src/Standard/Standard_Type.hxx

index c2fab1a..f42b034 100644 (file)
@@ -69,9 +69,9 @@ LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
 export PATH="@CMAKE_BINARY_DIR@/${BIN_PATH}:${PATH}"
 
 if [ "$LD_LIBRARY_PATH" != "" ]; then
-  export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
+  export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
 else
-  export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}"
+  export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/${LIBS_PATH}:${THRDPARTY_PATH}"
 fi
 
 if [ "$WOKSTATION" == "mac" ]; then
index ee763ae..61b3790 100644 (file)
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
index 5c09f22..876dade 100644 (file)
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
index 6e180d9..7cbdfed 100644 (file)
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       </HeaderFileName>
     </Midl>
     <ClCompile>
-      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalIncludeDirectories>__TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
index 9bd7358..69cbaaf 100644 (file)
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalOptions="-MP"
+                               AdditionalOptions="-MP /bigobj"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
                                InlineFunctionExpansion="1"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalOptions="-MP -favor:blend"
+                               AdditionalOptions="-MP -favor:blend /bigobj"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="2"
                                InlineFunctionExpansion="1"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalOptions="-MP -favor:blend"
+                               AdditionalOptions="-MP -favor:blend /bigobj"
                                AdditionalIncludeDirectories="__TKINC__;$(CSF_OPT_INC)"
                                Optimization="0"
                                InlineFunctionExpansion="1"
index ac7df36..902db3d 100644 (file)
@@ -29,9 +29,6 @@
 #include <Aspect_Convert.hxx>
 #include <Aspect_WindowDefinitionError.hxx>
 
-IMPLEMENT_STANDARD_HANDLE (Cocoa_Window, Aspect_Window)
-IMPLEMENT_STANDARD_RTTIEXT(Cocoa_Window, Aspect_Window)
-
 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
   //
 #else
index bef2dc8..e419a5a 100644 (file)
@@ -531,18 +531,12 @@ Standard_Boolean Draw_Window::Save (Standard_CString theFileName) const
                                   [NSNumber numberWithInt: NSJPEGFileType], @"jpg",
                                   [NSNumber numberWithInt: NSGIFFileType],  @"gif",
                                   nil];
-
-  NSBitmapImageFileType aFileType;
-
-  if ([aFileTypeDict valueForKey: aFileExtension] != nil)
-  {
-    aFileType = [[aFileTypeDict valueForKey: aFileExtension] intValue];
-  }
-  else
+  if ([aFileTypeDict valueForKey: aFileExtension] == NULL)
   {
     return Standard_False; // unsupported image extension
   }
 
+  NSBitmapImageFileType aFileType = (NSBitmapImageFileType )[[aFileTypeDict valueForKey: aFileExtension] intValue];
   NSBitmapImageRep* anImageRep = [NSBitmapImageRep imageRepWithData: [myImageBuffer TIFFRepresentation]];
 
   NSData* aData = [anImageRep representationUsingType: aFileType 
index c9befb8..97d8535 100644 (file)
@@ -162,6 +162,8 @@ namespace opencascade {
   template <typename T>
   const Handle(Standard_Type)& type_instance<T>::get ()
   {
+    (void)myInstance; // ensure that myInstance is instantiated
+
     // static variable inside function ensures that descriptors
     // are initialized in correct sequence
     static Handle(Standard_Type) anInstance =