From 7e859a41b16e75ed3b96255aec45c72f716c0328 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 14 Aug 2016 12:53:05 +0200 Subject: cmake/mingw-w64: debloat flags are relevant only for c++ --- cmake/mingw-w64.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmake') diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake index e4f149b0..1566eac0 100644 --- a/cmake/mingw-w64.cmake +++ b/cmake/mingw-w64.cmake @@ -40,10 +40,11 @@ set(fpu "-ffast-math -mfpmath=both -mstackrealign -ftree-vectorize -falign-funct set(cpu "-O3 -pipe -march=pentium4 -mtune=corei7-avx -msse -msse2 -mno-sse3 -mno-avx -frename-registers -fno-PIC") set(lto "-flto -fuse-linker-plugin -flto-compression-level=9 -flto-partition=none -fipa-icf -fipa-pta -flto-odr-type-merging") set(bloat "-fno-exceptions -fno-rtti") +set(sections "-ffunction-sections -fdata-sections") -set(_CFLAGS " -fvisibility=hidden") -set(_CXXFLAGS "${_CFLAGS}") -set(_CFLAGS_RELEASE "-s ${cpu} ${fpu} ${lto} ${bloat}") +set(_CFLAGS "-fvisibility=hidden") +set(_CXXFLAGS "${bloat} ${_CFLAGS}") +set(_CFLAGS_RELEASE "-s ${cpu} ${fpu} ${lto} ${sections}") set(_CFLAGS_DEBUG "-g -O0 -fstack-protector-strong") set(_CXXFLAGS_RELEASE "${_CFLAGS_RELEASE}") set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}") -- cgit v1.2.3