@ -62,7 +62,6 @@ if (YUZU_STATIC_ROOM)
set ( Boost_USE_STATIC_LIBS ON )
set ( CMAKE_FIND_LIBRARY_SUFFIXES ".a" )
set ( OPENSSL_USE_STATIC_LIBS ON )
set ( YUZU_USE_CPM ON )
set ( zstd_FORCE_BUNDLED ON )
set ( fmt_FORCE_BUNDLED ON )
@ -126,8 +125,6 @@ if (YUZU_STATIC_BUILD)
set ( HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF )
elseif ( APPLE )
set ( YUZU_USE_CPM ON )
set ( YUZU_USE_BUNDLED_FFMPEG ON )
set ( YUZU_USE_BUNDLED_SDL2 ON )
set ( YUZU_USE_BUNDLED_OPENSSL ON )
@ -189,8 +186,6 @@ if (MSVC OR ANDROID)
set ( EXT_DEFAULT ON )
endif ( )
option ( YUZU_USE_CPM "Use CPM to fetch system dependencies (fmt, boost, etc) if needed. Externals will still be fetched." ${ EXT_DEFAULT } )
# f f m p e g
option ( YUZU_USE_BUNDLED_FFMPEG "Download bundled FFmpeg" ${ EXT_DEFAULT } )
cmake_dependent_option ( YUZU_USE_EXTERNAL_FFMPEG "Build FFmpeg from external source" "${PLATFORM_SUN}" "NOT WIN32 AND NOT ANDROID" OFF )
@ -369,6 +364,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set ( THREADS_PREFER_PTHREAD_FLAG ON )
find_package ( Threads REQUIRED )
find_package ( RenderDoc MODULE )
# o p e n s s l f u n n i n e s s
if ( YUZU_USE_BUNDLED_OPENSSL )
set ( BUILD_SHARED_LIBS OFF )
@ -380,107 +377,82 @@ endif()
find_package ( OpenSSL 3 REQUIRED )
if ( YUZU_USE_CPM )
message ( STATUS "Fetching needed dependencies with CPM" )
message ( STATUS "Fetching needed dependencies with CPM" )
set ( BUILD_SHARED_LIBS OFF )
set ( BUILD_TESTING OFF )
set ( ENABLE_TESTING OFF )
set ( BUILD_SHARED_LIBS OFF )
set ( BUILD_TESTING OFF )
set ( ENABLE_TESTING OFF )
# TODO ( crueter ) : r e n d e r d o c ?
# b o o s t
set ( BOOST_INCLUDE_LIBRARIES algorithm icl pool container heap asio headers process filesystem crc variant )
# b o o s t
set ( BOOST_INCLUDE_LIBRARIES algorithm icl pool container heap asio headers process filesystem crc variant )
AddJsonPackage ( boost )
AddJsonPackage ( boost )
# r e a l l y a n n o y i n g t h i n g w h e r e b o o s t : : h e a d e r s d o e s n ' t w o r k w i t h c p m
# TODO ( crueter ) i n v e s t i g a t e
set ( BOOST_NO_HEADERS ${ Boost_ADDED } )
# r e a l l y a n n o y i n g t h i n g w h e r e b o o s t : : h e a d e r s d o e s n ' t w o r k w i t h c p m
# TODO ( crueter ) i n v e s t i g a t e
set ( BOOST_NO_HEADERS ${ Boost_ADDED } )
if ( Boost_ADDED )
if ( MSVC OR ANDROID )
add_compile_definitions ( YUZU_BOOST_v1 )
endif ( )
if ( Boost_ADDED )
if ( MSVC OR ANDROID )
add_compile_definitions ( YUZU_BOOST_v1 )
if ( NOT MSVC OR CXX_CLANG )
# b o o s t s u c k s
if ( PLATFORM_SUN )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthreads" )
endif ( )
if ( NOT MSVC OR CXX_CLANG )
# b o o s t s u c k s
if ( PLATFORM_SUN )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthreads" )
endif ( )
target_compile_options ( boost_heap INTERFACE -Wno-shadow )
target_compile_options ( boost_icl INTERFACE -Wno-shadow )
target_compile_options ( boost_asio INTERFACE -Wno-conversion -Wno-implicit-fallthrough )
endif ( )
target_compile_options ( boost_heap INTERFACE -Wno-shadow )
target_compile_options ( boost_icl INTERFACE -Wno-shadow )
target_compile_options ( boost_asio INTERFACE -Wno-conversion -Wno-implicit-fallthrough )
endif ( )
endif ( )
# f m t
AddJsonPackage ( fmt )
# f m t
AddJsonPackage ( fmt )
# l z 4
AddJsonPackage ( lz4 )
# l z 4
AddJsonPackage ( lz4 )
if ( lz4_ADDED )
add_library ( lz4::lz4 ALIAS lz4_static )
endif ( )
if ( lz4_ADDED )
add_library ( lz4::lz4 ALIAS lz4_static )
endif ( )
# z s t d
AddJsonPackage ( zstd )
# z s t d
AddJsonPackage ( zstd )
if ( zstd_ADDED )
add_library ( zstd::zstd ALIAS libzstd_static )
add_library ( zstd::libzstd ALIAS libzstd_static )
endif ( )
if ( NOT YUZU_STATIC_ROOM )
# n l o h m a n n
AddJsonPackage ( nlohmann )
if ( zstd_ADDED )
add_library ( zstd::zstd ALIAS libzstd_static )
add_library ( zstd::libzstd ALIAS libzstd_static )
endif ( )
# z l i b
AddJsonPackage ( zlib )
if ( NOT YUZU_STATIC_ROOM )
# n l o h m a n n
AddJsonPackage ( nlohmann )
if ( ZLIB_ADDED )
add_library ( ZLIB::ZLIB ALIAS zlibstatic )
endif ( )
# z l i b
AddJsonPackage ( zlib )
# O p u s
AddJsonPackage ( opus )
if ( ZLIB_ADDED )
add_library ( ZLIB::ZLIB ALIAS zlibstatic )
endif ( )
if ( Opus_ADDED )
if ( MSVC AND CXX_CLANG )
target_compile_options ( opus PRIVATE
- W n o - i m p l i c i t - f u n c t i o n - d e c l a r a t i o n
)
endif ( )
endif ( )
# O p u s
AddJsonPackage ( opus )
if ( NOT TARGET Opus::opus )
add_library ( Opus::opus ALIAS opus )
if ( Opus_ADDED )
if ( MSVC AND CXX_CLANG )
target_compile_options ( opus PRIVATE
- W n o - i m p l i c i t - f u n c t i o n - d e c l a r a t i o n
)
endif ( )
endif ( )
else ( )
# T O D O : w e c a n p r o b a b l y j u s t u s e C P M f o r t h i s . . . r i g h t ?
# E n f o r c e t h e s e a r c h m o d e o f n o n - r e q u i r e d p a c k a g e s f o r b e t t e r a n d s h o r t e r f a i l u r e m e s s a g e s
find_package ( fmt 8 REQUIRED )
if ( NOT YUZU_DISABLE_LLVM )
find_package ( LLVM MODULE COMPONENTS Demangle )
if ( NOT TARGET Opus::opus )
add_library ( Opus::opus ALIAS opus )
endif ( )
find_package ( nlohmann_json 3.8 REQUIRED )
find_package ( lz4 REQUIRED )
find_package ( RenderDoc MODULE )
find_package ( stb MODULE )
find_package ( Opus 1.3 MODULE REQUIRED )
find_package ( ZLIB 1.2 REQUIRED )
find_package ( zstd 1.5 REQUIRED MODULE )
# w o w
find_package ( Boost 1.57.0 CONFIG REQUIRED OPTIONAL_COMPONENTS headers context system fiber filesystem )
endif ( )
if ( NOT TARGET Boost::headers )