1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0024227: Enable SSE2 instructions for OCCT building

CMake script changed: SSE2 option is disabled for 64-bit MSVC compilers (redundant)
This commit is contained in:
abv 2013-10-17 09:20:30 +04:00 committed by bugmaster
parent b70bbe5845
commit 4d42a1a548

View File

@ -37,18 +37,24 @@ else()
set(SCRIPT_EXT sh)
endif()
# set compiler short name and choose SSE2 option for appropriate MSVC compilers
if (DEFINED MSVC70)
SET(COMPILER vc7)
add_definitions(/arch:SSE2)
elseif (DEFINED MSVC80)
SET(COMPILER vc8)
add_definitions(/arch:SSE2)
if (${COMPILER_BITNESS} STREQUAL 32)
add_definitions(/arch:SSE2)
endif()
elseif (DEFINED MSVC90)
SET(COMPILER vc9)
add_definitions(/arch:SSE2)
if (${COMPILER_BITNESS} STREQUAL 32)
add_definitions(/arch:SSE2)
endif()
elseif (DEFINED MSVC10)
SET(COMPILER vc10)
add_definitions(/arch:SSE2)
if (${COMPILER_BITNESS} STREQUAL 32)
add_definitions(/arch:SSE2)
endif()
elseif (DEFINED MSVC11)
SET(COMPILER vc11)
else()
@ -68,6 +74,7 @@ else()
add_definitions(-fexceptions -fPIC -DOCC_CONVERT_SIGNALS -DHAVE_WOK_CONFIG_H -DHAVE_CONFIG_H -DLIN)
endif()
# enable structured exceptions for MSVC
string(REGEX MATCH "EHsc" ISFLAG "${CMAKE_CXX_FLAGS}")
IF(ISFLAG)
STRING(REGEX REPLACE "EHsc" "EHa" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
@ -75,13 +82,14 @@ ELSEIF(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -EHa")
ENDIF()
# enable parallel compilation on MSVC 9 and above
IF(WIN32)
IF(NOT DEFINED MSVC70 AND NOT DEFINED MSVC80)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP")
ENDIF()
ENDIF()
# warning level 4
# increase compiler warnings level (-W4 for MSVC, -Wall for GCC)
IF(MSVC)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")