0026247: Too huge binaries are produced for Android platform using MinGW
authorski <ski@opencascade.com>
Fri, 10 Jul 2015 07:52:53 +0000 (10:52 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 19 Nov 2015 11:37:46 +0000 (14:37 +0300)
Parameter "-s" was added to CMAKE_CXX_FLAGS_RELEASE and CMAKE_C_FLAGS_RELEASE to optimize size of binaries

adm/cmake/occt_defs_flags.cmake

index 6dd762f..a8d4b71 100644 (file)
@@ -90,5 +90,11 @@ if (DEFINED CMAKE_COMPILER_IS_GNUCXX OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xC
   set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
 endif()
 
+# Optimize size of binaries
+if (NOT WIN32 AND NOT APPLE)
+  set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+  set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
+endif()
+
 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
 set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
\ No newline at end of file