Tooling updates; requires a higher cmake version in abseil and co...

This commit is contained in:
paulfd 2019-09-21 01:33:03 +02:00
parent 27efcd029d
commit 1700068d1e
2 changed files with 9 additions and 3 deletions

View file

@ -4,11 +4,14 @@ project(sfizz VERSION 1.0.0 LANGUAGES CXX)
# Set the highest possible standard
set(CMAKE_CXX_STANDARD 17)
cmake_policy(SET CMP0069 NEW)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT ANDROID)
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
else()
else()
add_link_options(-lstdc++fs)
endif()

View file

@ -37,19 +37,22 @@ endif()
set(SFIZZ_SOURCES ${SFIZZ_SOURCES} ${SFIZZ_SIMD_SOURCES})
add_library(sfizz_parser STATIC)
target_sources(sfizz_parser PUBLIC Parser.cpp Opcode.cpp)
target_sources(sfizz_parser PRIVATE Parser.cpp Opcode.cpp)
target_include_directories(sfizz_parser PUBLIC .)
if(UNIX)
target_link_libraries(sfizz_parser PUBLIC stdc++fs)
# target_compile_options(sfizz_parser PUBLIC -fno-rtti -fno-exceptions)
endif(UNIX)
target_link_libraries(sfizz_parser PRIVATE absl::strings)
add_library(sfizz STATIC ${SFIZZ_SOURCES})
target_link_libraries(sfizz PRIVATE sfizz_parser)
target_include_directories(sfizz PUBLIC .)
find_package(Threads REQUIRED)
target_link_libraries(sfizz PRIVATE Threads::Threads)
if(UNIX)
target_link_libraries(sfizz PUBLIC stdc++fs atomic)
target_compile_options(sfizz PRIVATE -fno-rtti -fno-exceptions)
# target_compile_options(sfizz PUBLIC -fno-rtti -fno-exceptions)
endif(UNIX)
target_link_libraries(sfizz PUBLIC absl::strings)
target_link_libraries(sfizz PRIVATE sndfile absl::flat_hash_map)