better -ffast-math handling
issue #488 See also http://public.kitware.com/pipermail/cmake/2015-April/060479.html
This commit is contained in:
parent
5b66156be4
commit
e4735c703d
|
@ -190,7 +190,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
# For all builds, make sure openjpeg is std99 compliant:
|
# 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.
|
# 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:
|
# 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()
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -85,6 +85,7 @@ if(UNIX)
|
||||||
target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)
|
target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
set_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
||||||
|
target_compile_options(${OPENJPEG_LIBRARY_NAME} PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
||||||
|
|
||||||
# Install library
|
# Install library
|
||||||
install(TARGETS ${OPENJPEG_LIBRARY_NAME}
|
install(TARGETS ${OPENJPEG_LIBRARY_NAME}
|
||||||
|
|
|
@ -27,6 +27,7 @@ if(UNIX)
|
||||||
target_link_libraries(${OPENJP3D_LIBRARY_NAME} m)
|
target_link_libraries(${OPENJP3D_LIBRARY_NAME} m)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(${OPENJP3D_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
set_target_properties(${OPENJP3D_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
||||||
|
target_compile_options(${OPENJP3D_LIBRARY_NAME} PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
||||||
|
|
||||||
# Install library
|
# Install library
|
||||||
install(TARGETS ${OPENJP3D_LIBRARY_NAME}
|
install(TARGETS ${OPENJP3D_LIBRARY_NAME}
|
||||||
|
|
|
@ -61,6 +61,7 @@ endif()
|
||||||
add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
||||||
set_target_properties(openjpip
|
set_target_properties(openjpip
|
||||||
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
||||||
|
target_compile_options(openjpip PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
||||||
target_link_libraries(openjpip ${OPENJPEG_LIBRARY_NAME})
|
target_link_libraries(openjpip ${OPENJPEG_LIBRARY_NAME})
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# add Winsock on windows+mingw
|
# add Winsock on windows+mingw
|
||||||
|
|
|
@ -51,6 +51,7 @@ if(UNIX)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(openjpwl
|
set_target_properties(openjpwl
|
||||||
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
||||||
|
target_compile_options(openjpwl PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
||||||
|
|
||||||
# Install library
|
# Install library
|
||||||
install(TARGETS openjpwl
|
install(TARGETS openjpwl
|
||||||
|
|
|
@ -46,6 +46,7 @@ if(UNIX)
|
||||||
target_link_libraries(${OPENMJ2_LIBRARY_NAME} m)
|
target_link_libraries(${OPENMJ2_LIBRARY_NAME} m)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(${OPENMJ2_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
set_target_properties(${OPENMJ2_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
||||||
|
target_compile_options(${OPENJ2_LIBRARY_NAME} PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
||||||
|
|
||||||
# Install library
|
# Install library
|
||||||
install(TARGETS ${OPENMJ2_LIBRARY_NAME}
|
install(TARGETS ${OPENMJ2_LIBRARY_NAME}
|
||||||
|
|
Loading…
Reference in New Issue