mirror of
https://github.com/ZDoom/ZMusic.git
synced 2025-02-07 08:01:14 +00:00
- Prefer target properties instead of setting variables whenever possible. A zmusic-obj target now exists to represent the commonality between zmusic and zmusiclite. - Factored out as much as possible from global settings to per target settings which will make it easier to support using ZMusic as a submodule. Moved helper functions into a ZUtility.cmake module. - We now generate and install ZMusicConfig.cmake so find_package(ZMusic) will work either automatically or given ZMusic_DIR is set. - CPack is enabled although some refinement is still needed. - Requires CMake >= 3.13 which is newer than I would normally like, but given how no one like to refactor these things it may be better to deal with the short term pain of going a little aggressive on the requirement in order to avoid having to make things ugly. Especially given that these scripts have a tendency to be copy/pasted into sister projects. CMake itself has very few dependencies so users of old Linux distros should be able to easily compile a supported version of CMake. - On Windows CMake >= 3.15 is required for redistributable results. - Cleaned out bits that were copied from GZDoom but not relevant to ZMusic.
29 lines
615 B
CMake
29 lines
615 B
CMake
add_library(wildmidi OBJECT
|
|
file_io.cpp
|
|
gus_pat.cpp
|
|
reverb.cpp
|
|
wildmidi_lib.cpp
|
|
wm_error.cpp
|
|
)
|
|
|
|
file(GLOB HEADER_FILES wildmidi/*.h)
|
|
target_sources(wildmidi PRIVATE ${HEADER_FILES})
|
|
|
|
set_target_properties(wildmidi
|
|
PROPERTIES
|
|
CXX_STANDARD 11
|
|
CXX_STANDARD_REQUIRED ON
|
|
)
|
|
|
|
target_include_directories(wildmidi INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE wildmidi)
|
|
|
|
use_fast_math(wildmidi)
|
|
require_stricmp(wildmidi PRIVATE)
|
|
require_strnicmp(wildmidi PRIVATE)
|
|
|
|
if(COMPILER_IS_GNUC_COMPATIBLE)
|
|
target_compile_options(wildmidi
|
|
PRIVATE
|
|
"-Wall" "-Wextra" "-Wno-unused-parameter" "-fomit-frame-pointer"
|
|
)
|
|
endif()
|