CMake: 3.13 as minimum for non Windows platforms, plus minor fixes
This commit is contained in:
parent
206786447e
commit
899e988c8c
3 changed files with 12 additions and 5 deletions
|
|
@ -2,7 +2,8 @@ if(WIN32)
|
|||
cmake_minimum_required(VERSION 3.15)
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
else()
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
# USE_LIBCPP requires add_link_options() in SfizzConfig.cmake
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
endif()
|
||||
|
||||
project(libsfizz
|
||||
|
|
|
|||
|
|
@ -117,15 +117,16 @@ cmake_dependent_option(USE_LIBCPP "Use libc++ with clang" "${APPLE}"
|
|||
"CMAKE_CXX_COMPILER_ID MATCHES Clang" OFF)
|
||||
if(USE_LIBCPP)
|
||||
add_compile_options(-stdlib=libc++)
|
||||
# Presumably need the above for linking too, maybe other options missing as well
|
||||
add_link_options(-stdlib=libc++) # New command on CMake master, not in 3.12 release
|
||||
add_link_options(-lc++abi) # New command on CMake master, not in 3.12 release
|
||||
add_link_options(-stdlib=libc++) # New command in CMake 3.13
|
||||
add_link_options(-lc++abi)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
set(PROJECT_IS_MAIN TRUE)
|
||||
else()
|
||||
set(PROJECT_IS_MAIN FALSE)
|
||||
endif()
|
||||
|
||||
# Don't show build information when building a different project
|
||||
|
|
|
|||
|
|
@ -330,7 +330,12 @@ if(SFIZZ_SHARED)
|
|||
target_include_directories(sfizz_shared PUBLIC .)
|
||||
target_link_libraries(sfizz_shared PRIVATE sfizz::internal)
|
||||
target_compile_definitions(sfizz_shared PRIVATE SFIZZ_EXPORT_SYMBOLS)
|
||||
set_target_properties(sfizz_shared PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION_MAJOR}" OUTPUT_NAME "sfizz" PUBLIC_HEADER "sfizz.h;sfizz.hpp;sfizz_message.h")
|
||||
set_target_properties(sfizz_shared PROPERTIES
|
||||
VERSION "${PROJECT_VERSION}"
|
||||
SOVERSION "${PROJECT_VERSION_MAJOR}"
|
||||
OUTPUT_NAME "sfizz"
|
||||
PUBLIC_HEADER "sfizz.h;sfizz.hpp;sfizz_message.h"
|
||||
)
|
||||
sfizz_enable_lto_if_needed(sfizz_shared)
|
||||
|
||||
if(NOT MSVC)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue