From 6f9cf1e5ed7d5146a0169850e0b4b652802c74ba Mon Sep 17 00:00:00 2001 From: Xu Han Date: Thu, 8 Feb 2024 22:40:24 +0800 Subject: [PATCH] update code. --- CMakeLists.txt | 10 ++-------- Configure.cmake | 5 +++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45bccbdc..e4053d82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,15 +157,9 @@ separate build directory. Note: Please remove autogenerated file \ `CMakeCache.txt` and directory `CMakeFiles` in the current directory.") endif() -# Config sleef static lib -if (NOT SLEEF_BUILD_SHARED_LIBS) - set(COMMON_TARGET_DEFINITIONS SLEEF_STATIC_LIBS=1) - set(SLEEF_STATIC_LIBS 1) -endif() - -if(SLEEF_ENABLE_LTO AND SLEEF_STATIC_LIBS) +if(SLEEF_ENABLE_LTO AND SLEEF_SLEEF_BUILD_SHARED_LIBS) message(FATAL_ERROR "SLEEF_ENABLE_LTO and SLEEF_STATIC_LIBS cannot be specified at the same time") -endif(SLEEF_ENABLE_LTO AND SLEEF_STATIC_LIBS) +endif(SLEEF_ENABLE_LTO AND SLEEF_SLEEF_BUILD_SHARED_LIBS) if(SLEEF_ENABLE_LTO) cmake_policy(SET CMP0069 NEW) diff --git a/Configure.cmake b/Configure.cmake index 87043717..0907f2c4 100644 --- a/Configure.cmake +++ b/Configure.cmake @@ -832,6 +832,11 @@ endif() # Set common definitions +if (NOT SLEEF_SLEEF_BUILD_SHARED_LIBS) + set(COMMON_TARGET_DEFINITIONS SLEEF_STATIC_LIBS=1) + set(SLEEF_STATIC_LIBS 1) +endif() + if (COMPILER_SUPPORTS_WEAK_ALIASES) set(COMMON_TARGET_DEFINITIONS ${COMMON_TARGET_DEFINITIONS} ENABLE_ALIAS=1) endif()