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

0027053: Compilation fails with "fatal error RC1103: invalid option, /fp:precise"

CMake script is corrected to add compiler options (except macro definitions) to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS variables directly, instead of using add_definitions() command.
This eliminates failure of build by NMake due to incorrect options passed to RC compiler.
This commit is contained in:
abv 2016-01-24 09:28:08 +03:00
parent ba3d7cdfbb
commit 100592c117

View File

@ -5,25 +5,27 @@ if(FLAGS_ALREADY_INCLUDED)
endif()
set(FLAGS_ALREADY_INCLUDED 1)
if (MSVC)
add_definitions(/fp:precise)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp:precise")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp:precise")
endif()
# set compiler short name and choose SSE2 option for appropriate MSVC compilers
# ONLY for 32-bit
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
if (MSVC80 OR MSVC90 OR MSVC10)
add_definitions(/arch:SSE2)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:SSE2")
endif()
endif()
if (WIN32)
add_definitions (-wd4996)
elseif (APPLE)
add_definitions (-fexceptions -fPIC -DOCC_CONVERT_SIGNALS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4996")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4996")
else()
add_definitions (-fexceptions -fPIC -DOCC_CONVERT_SIGNALS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions -fPIC")
add_definitions(-DOCC_CONVERT_SIGNALS)
endif()
# enable structured exceptions for MSVC