Use -ffast-math only for compilation

Updates #488
Closes #554
This commit is contained in:
mayeut 2015-10-15 14:59:36 +02:00
parent 618e50954f
commit 650df81e09
3 changed files with 8 additions and 4 deletions

View File

@ -203,7 +203,7 @@ IF(CMAKE_COMPILER_IS_GNUCC)
# For all builds, make sure openjpeg is std99 compliant:
# SET(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
# Do not use ffast-math for all build, it would produce incorrect results, only set for release:
SET(CMAKE_C_FLAGS_RELEASE "-ffast-math ${CMAKE_C_FLAGS_RELEASE}")
SET(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
#-----------------------------------------------------------------------------

View File

@ -39,7 +39,9 @@ IF(UNIX)
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME} m)
ENDIF(UNIX)
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
IF(${CMAKE_VERSION} VERSION_GREATER "2.8.11")
TARGET_COMPILE_OPTIONS(${OPENJPEG_LIBRARY_NAME} PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
ENDIF()
# Build the JPWL library ?
IF(BUILD_JPWL)
ADD_SUBDIRECTORY(jpwl)

View File

@ -26,8 +26,10 @@ ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS})
IF(UNIX)
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME}_JPWL m)
ENDIF(UNIX)
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JPWL
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JPWL PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
IF(${CMAKE_VERSION} VERSION_GREATER "2.8.11")
TARGET_COMPILE_OPTIONS(${OPENJPEG_LIBRARY_NAME}_JPWL PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
ENDIF()
# Install library
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL