diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-06-15 08:13:46 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-06-15 08:13:46 +0200 |
commit | 1661572fcc8eed78d5cb20edf5e8478d4616ce36 (patch) | |
tree | f4e85a8cecff5517c1e1f90d4a64dc51f0d2bf95 /cmake/mingw-w64.cmake | |
parent | 879351cffc896a64513da6b7e076f1cd907f9db8 (diff) |
cmake: now able to build with IPA with minor changes
For OpenCV videoio/cap_dshow.cpp, deactivate LTO for just that file.
Either with cmake or #pragma. Otherwise opening the camera causes a
crash in DShow machinery.
LibOVR build without LTO completely as there are some duplicate symbol
errors.
Other than that, LTO build seems to work fine.
Diffstat (limited to 'cmake/mingw-w64.cmake')
-rw-r--r-- | cmake/mingw-w64.cmake | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake index 1680166a..7e34746d 100644 --- a/cmake/mingw-w64.cmake +++ b/cmake/mingw-w64.cmake @@ -25,14 +25,16 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(lto "-flto -fuse-linker-plugin -flto-partition=none -fno-fat-lto-objects") -set(rice "-ftree-vectorize -ffast-math -mfpmath=both -fipa-pta -fmerge-all-constants -fipa-icf -fivopts -fweb") -set(cpu "-march=i686 -mtune=corei7-avx -msse -msse2 -mno-sse3 -mno-avx") +set(lto "-flto -fuse-linker-plugin") +set(rice "-fmerge-all-constants -fipa-pta -fipa-icf -fweb -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse-sm -fgcse-las") +set(cpu "-O3 -march=i686 -mtune=corei7-avx -ffast-math -mfpmath=both -msse -msse2 -mno-sse3 -mno-avx") +set(lto-link "${lto} -flto-partition=none -fno-fat-lto-objects") set(CFLAGS-OVERRIDE "" CACHE STRING "") -set(CMAKE_C_FLAGS_RELEASE "-O3 ${rice} ${lto} ${cpu} ${CFLAGS-OVERRIDE}" CACHE STRING "" FORCE) -set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-msse -msse2 -mno-sse3 -mno-avx ${lto}" CACHE STRING "" FORCE) -set(CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}) +set(CMAKE_C_FLAGS_RELEASE "${rice} ${lto} ${cpu} ${CFLAGS-OVERRIDE}" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${cpu} ${lto-link} ${CFLAGS-OVERRIDE}" CACHE STRING "" FORCE) +set(CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} CACHE STRING "" FORCE) +set(CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} CACHE STRING "" FORCE) set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE) |