DiscussionsIssue archiveOCCT:Configuration

Archived issue #0026247

Configuration, CMake - strip symbols within Release configuration when using non-msvc

Open CASCADEOCCT:Configurationclosed18 public notes

Search issues

Description

By default binaries with unstripped symbols are produced using MinGW in release mode (-DBUILD_CONFIGURATION:STRING=Release, shared). As a result size of binaries is 3 times greater than expected (e.g. TKernel occupies 6Mb instead of 1.8Mb).

Adding "-s" parameter to CMAKE_CXX_FLAGS_RELEASE can solve this problem.

Steps to reproduce

N/A

Public activity

18 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: ski
Date: Fri Jun 19 16:09:25 2015 +0300

    0026247: Too huge binaries are produced for Android platform using MinGW
    
    Parameter "-s" was added to CMAKE_CXX_FLAGS_RELEASE for MinGW compiler to optimize size of binaries
02Commenter 2
Parameter "-s" was added to CMAKE_CXX_FLAGS_RELEASE for MinGW compiler to optimize size of binaries in release mode

Size of binaries:
• without fix - 189 Mb
• with fix - 42 Mb

Dear ibs,
please review.
03Commenter 3
+# Optimize size of binaries for MinGW compiler
+if ("${CMAKE_GENERATOR}" STREQUAL "MinGW Makefiles")
+  set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+endif()

does this problem is MinGW-specific?
04Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
05Commenter 5
occt branch CR26247 was updated.

I have tried to compile occt on linux station with "-s" parameter and got next results:

Size of binaries:
• without fix - 77 Mb
• with fix - 64 Mb

Dear kgv,
please review.
06Commenter 3
Please test the patch and integrate.
07Commenter 1
Insertion of -s option cause crash compilation on MacOS platform
08Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
09Commenter 9
Branch CR26247 was rebased on current state of master.

Since now, option "-s" will not be added during compilation on Windows and Mac stations.

Please, review.
10Commenter 3
+# Optimize size of binaries
+if (NOT WIN32 AND NOT APPLE)
+  set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+endif()

the same parameter should be added to C compiler options within Release configuration.
11Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
12Commenter 12
CMAKE_C_FLAGS_RELEASE is also considered. Please review CR26247 branch of OCCT git
13Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
14Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
15Commenter 15
dear ski,
please review CR26247 branch of OCCT git
16Commenter 16
Reviewed. no remarks, please test.
17Commenter 1
Size of libraries decreased from 114 Mb till 96 Mb

18Commenter 2
Branch [archived branch] has been deleted by Commenter 3.

[revision removed]

Related records