From 52f7e0d0a8e0a66b5147ce6e80bb48c70d50add8 Mon Sep 17 00:00:00 2001 From: abv Date: Fri, 17 Jul 2015 11:43:33 +0300 Subject: [PATCH] 0024002: Overall code and build procedure refactoring -- Mac OSX 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 | 4 ++-- adm/templates/template.vc10 | 6 +++--- adm/templates/template.vc11 | 6 +++--- adm/templates/template.vc12 | 6 +++--- adm/templates/template.vc9 | 6 +++--- src/Cocoa/Cocoa_Window.mm | 3 --- src/Draw/Draw_Window_1.mm | 10 ++-------- src/Standard/Standard_Type.hxx | 2 ++ 8 files changed, 18 insertions(+), 25 deletions(-) diff --git a/adm/templates/env.build.sh.in b/adm/templates/env.build.sh.in index c2fab1afd1..f42b034320 100644 --- a/adm/templates/env.build.sh.in +++ b/adm/templates/env.build.sh.in @@ -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 diff --git a/adm/templates/template.vc10 b/adm/templates/template.vc10 index ee763aea74..61b3790a5c 100644 --- a/adm/templates/template.vc10 +++ b/adm/templates/template.vc10 @@ -120,7 +120,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true Disabled @@ -166,7 +166,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true MaxSpeed @@ -209,7 +209,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true Disabled diff --git a/adm/templates/template.vc11 b/adm/templates/template.vc11 index 5c09f22d72..876dadeb4c 100644 --- a/adm/templates/template.vc11 +++ b/adm/templates/template.vc11 @@ -123,7 +123,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true Disabled @@ -168,7 +168,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true MaxSpeed @@ -211,7 +211,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true Disabled diff --git a/adm/templates/template.vc12 b/adm/templates/template.vc12 index 6e180d990a..7cbdfeda49 100644 --- a/adm/templates/template.vc12 +++ b/adm/templates/template.vc12 @@ -123,7 +123,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true Disabled @@ -168,7 +168,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true MaxSpeed @@ -211,7 +211,7 @@ - %(AdditionalOptions) + /bigobj %(AdditionalOptions) __TKINC__;$(CSF_OPT_INC);%(AdditionalIncludeDirectories) true Disabled diff --git a/adm/templates/template.vc9 b/adm/templates/template.vc9 index 9bd7358289..69cbaaf9b3 100644 --- a/adm/templates/template.vc9 +++ b/adm/templates/template.vc9 @@ -146,7 +146,7 @@ /> #include -IMPLEMENT_STANDARD_HANDLE (Cocoa_Window, Aspect_Window) -IMPLEMENT_STANDARD_RTTIEXT(Cocoa_Window, Aspect_Window) - #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE // #else diff --git a/src/Draw/Draw_Window_1.mm b/src/Draw/Draw_Window_1.mm index bef2dc8475..e419a5a37e 100644 --- a/src/Draw/Draw_Window_1.mm +++ b/src/Draw/Draw_Window_1.mm @@ -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 diff --git a/src/Standard/Standard_Type.hxx b/src/Standard/Standard_Type.hxx index c9befb8563..97d8535002 100644 --- a/src/Standard/Standard_Type.hxx +++ b/src/Standard/Standard_Type.hxx @@ -162,6 +162,8 @@ namespace opencascade { template const Handle(Standard_Type)& type_instance::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 =