CMakeLists: Derive the source directory grouping from targets themselves
Removes the need to store to separate SRC and HEADER variables, and then construct the target in most cases.
This commit is contained in:
@ -1,40 +1,33 @@
|
||||
set(SRCS
|
||||
audio_core.cpp
|
||||
codec.cpp
|
||||
hle/dsp.cpp
|
||||
hle/filter.cpp
|
||||
hle/mixers.cpp
|
||||
hle/pipe.cpp
|
||||
hle/source.cpp
|
||||
interpolate.cpp
|
||||
sink_details.cpp
|
||||
time_stretch.cpp
|
||||
)
|
||||
add_library(audio_core STATIC
|
||||
audio_core.cpp
|
||||
audio_core.h
|
||||
codec.cpp
|
||||
codec.h
|
||||
hle/common.h
|
||||
hle/dsp.cpp
|
||||
hle/dsp.h
|
||||
hle/filter.cpp
|
||||
hle/filter.h
|
||||
hle/mixers.cpp
|
||||
hle/mixers.h
|
||||
hle/pipe.cpp
|
||||
hle/pipe.h
|
||||
hle/source.cpp
|
||||
hle/source.h
|
||||
interpolate.cpp
|
||||
interpolate.h
|
||||
null_sink.h
|
||||
sink.h
|
||||
sink_details.cpp
|
||||
sink_details.h
|
||||
time_stretch.cpp
|
||||
time_stretch.h
|
||||
|
||||
set(HEADERS
|
||||
audio_core.h
|
||||
codec.h
|
||||
hle/common.h
|
||||
hle/dsp.h
|
||||
hle/filter.h
|
||||
hle/mixers.h
|
||||
hle/pipe.h
|
||||
hle/source.h
|
||||
interpolate.h
|
||||
null_sink.h
|
||||
sink.h
|
||||
sink_details.h
|
||||
time_stretch.h
|
||||
)
|
||||
$<$<BOOL:SDL2_FOUND>:sdl2_sink.cpp sdl2_sink.h>
|
||||
)
|
||||
|
||||
if(SDL2_FOUND)
|
||||
set(SRCS ${SRCS} sdl2_sink.cpp)
|
||||
set(HEADERS ${HEADERS} sdl2_sink.h)
|
||||
endif()
|
||||
create_target_directory_groups(audio_core)
|
||||
|
||||
create_directory_groups(${SRCS} ${HEADERS})
|
||||
|
||||
add_library(audio_core STATIC ${SRCS} ${HEADERS})
|
||||
target_link_libraries(audio_core PUBLIC common core)
|
||||
target_link_libraries(audio_core PRIVATE SoundTouch)
|
||||
|
||||
|
Reference in New Issue
Block a user