diff --git a/src/libm/CMakeLists.txt b/src/libm/CMakeLists.txt index 25e11775..d0938750 100644 --- a/src/libm/CMakeLists.txt +++ b/src/libm/CMakeLists.txt @@ -972,25 +972,24 @@ endif() # TARGET_LIBSLEEFSCALAR # -------------------------------------------------------------------- # Build scalar-only library from sleefdp.c and sleefsp.c +if(SLEEF_BUILD_SCALAR_LIB) + add_library(sleefscalar sleefdp.c sleefsp.c rempitab.c) + add_dependencies(sleefscalar ${TARGET_HEADERS}) + set_target_properties(sleefscalar PROPERTIES + VERSION ${SLEEF_VERSION} + SOVERSION ${SLEEF_SOVERSION} + PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER} + ${COMMON_TARGET_PROPERTIES} + ) -add_library(sleefscalar sleefdp.c sleefsp.c rempitab.c) -add_dependencies(sleefscalar ${TARGET_HEADERS}) -set_target_properties(sleefscalar PROPERTIES - VERSION ${SLEEF_VERSION} - SOVERSION ${SLEEF_SOVERSION} - PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER} - ${COMMON_TARGET_PROPERTIES} -) - -target_compile_definitions(sleefscalar - PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS} -) + target_compile_definitions(sleefscalar + PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS} + ) -if(COMPILER_SUPPORTS_BUILTIN_MATH) - target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1) -endif() + if(COMPILER_SUPPORTS_BUILTIN_MATH) + target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1) + endif() -if(SLEEF_BUILD_SCALAR_LIB) install( TARGETS sleefscalar EXPORT sleefTargets