Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SLEEF_BUILD_SHARED_LIBS to override BUILD_SHARED_LIBS from including projects #531

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 10 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
cmake_minimum_required(VERSION 3.18)
project(SLEEF VERSION 3.6.0 LANGUAGES C)

set(SLEEF_SOVERSION ${SLEEF_VERSION_MAJOR})

# Options

Expand Down Expand Up @@ -63,7 +67,7 @@ set(SLEEF_ALL_SUPPORTED_EXTENSIONS
SVENOFMA SVE ADVSIMDNOFMA ADVSIMD # Aarch64
NEON32 NEON32VFPV4 # Aarch32
VSX VSXNOFMA VSX3 VSX3NOFMA # PPC64
VXE VXENOFMA VXE2 VXE2NOFMA # IBM Z
VXE VXENOFMA VXE2 VXE2NOFMA # IBM Z
blapie marked this conversation as resolved.
Show resolved Hide resolved
RVVM1NOFMA RVVM1 RVVM2NOFMA RVVM2 # RISC-V Vectors
PUREC_SCALAR PURECFMA_SCALAR # Generic type
CACHE STRING "List of SIMD architectures supported by libsleef."
Expand All @@ -74,7 +78,7 @@ set(SLEEF_SUPPORTED_LIBM_EXTENSIONS
SVENOFMA SVE ADVSIMDNOFMA ADVSIMD # Aarch64
NEON32 NEON32VFPV4 # Aarch32
VSX VSXNOFMA VSX3 VSX3NOFMA # PPC64
VXE VXENOFMA VXE2 VXE2NOFMA # IBM Z
VXE VXENOFMA VXE2 VXE2NOFMA # IBM Z
blapie marked this conversation as resolved.
Show resolved Hide resolved
RVVM1NOFMA RVVM1 RVVM2NOFMA RVVM2 # RISC-V Vectors
PUREC_SCALAR PURECFMA_SCALAR # Generic type
CACHE STRING "List of SIMD architectures supported by libsleef."
Expand Down Expand Up @@ -112,31 +116,15 @@ set(COSTOVERRIDE_RVVM2NOFMA 20)

#

cmake_minimum_required(VERSION 3.18)

if(${CMAKE_VERSION} VERSION_GREATER "3.14.99")
cmake_policy(SET CMP0091 NEW)
endif()

enable_testing()

set(SLEEF_VERSION_MAJOR 3)
set(SLEEF_VERSION_MINOR 6)
set(SLEEF_VERSION_PATCHLEVEL 0)
set(SLEEF_VERSION ${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR}.${SLEEF_VERSION_PATCHLEVEL})
set(SLEEF_SOVERSION ${SLEEF_VERSION_MAJOR})

set(LANGLIST C)

if (SLEEF_ENABLE_CUDA)
set(LANGLIST ${LANGLIST} CUDA)
endif()

if (SLEEF_ENABLE_CXX)
set(LANGLIST ${LANGLIST} CXX)
enable_language(CXX)
endif()

project(SLEEF VERSION ${SLEEF_VERSION} LANGUAGES ${LANGLIST})
if (SLEEF_ENABLE_CUDA)
enable_language(CUDA)
endif()

# For specifying installation directories
include(GNUInstallDirs)
Expand All @@ -162,7 +150,6 @@ if(SLEEF_ENABLE_LTO AND BUILD_SHARED_LIBS)
endif(SLEEF_ENABLE_LTO AND BUILD_SHARED_LIBS)

if(SLEEF_ENABLE_LTO)
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/libm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ if(SLEEF_BUILD_INLINE_HEADERS)
${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.tmp3
| ${SED_COMMAND}
# Embed version number into the header
-e "s/SLEEF_VERSION_SLEEF/${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR}.${SLEEF_VERSION_PATCHLEVEL}/g"
-e "s/SLEEF_VERSION_SLEEF/${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR}.${SLEEF_VERSION_PATCH}/g"
-e "s/SLEEF_SIMD_SLEEF/${SIMD}/g"
# Substitute "SLEEFSHARP" at the beginning of line with "#"
-e "s/^SLEEFSHARP/#/g"
Expand Down
2 changes: 1 addition & 1 deletion src/libm/sleef.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: SLEEF
Description: SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
Version: @SLEEF_VERSION_MAJOR@.@SLEEF_VERSION_MINOR@.@SLEEF_VERSION_PATCHLEVEL@
Version: @SLEEF_VERSION_MAJOR@.@SLEEF_VERSION_MINOR@.@SLEEF_VERSION_PATCH@
Cflags: -I${includedir}
Libs: -L${libdir} -lsleef
2 changes: 1 addition & 1 deletion src/libm/sleeflibm_header.h.org.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#define SLEEF_VERSION_MAJOR @SLEEF_VERSION_MAJOR@
#define SLEEF_VERSION_MINOR @SLEEF_VERSION_MINOR@
#define SLEEF_VERSION_PATCHLEVEL @SLEEF_VERSION_PATCHLEVEL@
#define SLEEF_VERSION_PATCHLEVEL @SLEEF_VERSION_PATCH@

#include <stddef.h>
#include <stdint.h>
Expand Down
4 changes: 2 additions & 2 deletions src/quad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ if(SLEEF_BUILD_INLINE_HEADERS)
${CMAKE_CURRENT_BINARY_DIR}/sleef${SIMD}.h.qtmp2
| ${SED_COMMAND}
# Embed version number into the header
-e "s/SLEEF_VERSION_SLEEF/${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR}.${SLEEF_VERSION_PATCHLEVEL}/g" # "s/SLEEF_VERSION_SLEEF/3.5.0/g"
-e "s/SLEEF_SIMD_SLEEF/${SIMD}/g" # -e "s/SLEEF_SIMD_SLEEF/SSE2/g"
-e "s/SLEEF_VERSION_SLEEF/${SLEEF_VERSION_MAJOR}.${SLEEF_VERSION_MINOR}.${SLEEF_VERSION_PATCH}/g" # "s/SLEEF_VERSION_SLEEF/3.5.0/g"
-e "s/SLEEF_SIMD_SLEEF/${SIMD}/g" # -e "s/SLEEF_SIMD_SLEEF/SSE2/g"
# Substitute "SLEEFSHARP" at the beginning of line with "#"
-e "s/^SLEEFSHARP/#/g"
# Remove SLEEFXXX
Expand Down
2 changes: 1 addition & 1 deletion src/quad/sleefquad_header.h.org.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#define SLEEF_VERSION_MAJOR @SLEEF_VERSION_MAJOR@
#define SLEEF_VERSION_MINOR @SLEEF_VERSION_MINOR@
#define SLEEF_VERSION_PATCHLEVEL @SLEEF_VERSION_PATCHLEVEL@
#define SLEEF_VERSION_PATCHLEVEL @SLEEF_VERSION_PATCH@

#include "sleef.h"
#include <string.h>
Expand Down