Fix CMake build

This commit is contained in:
Connor McLaughlin 2019-10-15 18:02:48 +10:00
parent aa792da823
commit e68cddf017
7 changed files with 65 additions and 10 deletions

View file

@ -19,6 +19,7 @@ if(WIN32)
set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/dep/msvc/include/SDL") set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/dep/msvc/include/SDL")
set(SDL2_LIBRARIES "SDL2") set(SDL2_LIBRARIES "SDL2")
set(SDL2_FOUND TRUE)
else() else()
find_package(SDL2 REQUIRED) find_package(SDL2 REQUIRED)
endif() endif()

View file

@ -1,11 +1,7 @@
add_subdirectory(glad) add_subdirectory(glad)
add_subdirectory(googletest)
add_subdirectory(imgui) add_subdirectory(imgui)
add_subdirectory(inih)
add_subdirectory(libsamplerate) add_subdirectory(libsamplerate)
add_subdirectory(nativefiledialog) add_subdirectory(stb)
add_subdirectory(softfloat)
add_subdirectory(xxhash)
###################### YBaseLib ############################ ###################### YBaseLib ############################

View file

@ -20,7 +20,7 @@ if(WIN32)
target_sources(imgui PRIVATE include/imgui_impl_dx11.h src/imgui_impl_dx11.cpp) target_sources(imgui PRIVATE include/imgui_impl_dx11.h src/imgui_impl_dx11.cpp)
endif() endif()
if(ENABLE_SDL_FRONTEND) if(SDL2_FOUND)
target_sources(imgui PRIVATE target_sources(imgui PRIVATE
include/imgui_impl_opengl3.h include/imgui_impl_opengl3.h
include/imgui_impl_sdl.h include/imgui_impl_sdl.h

8
dep/stb/CMakeLists.txt Normal file
View file

@ -0,0 +1,8 @@
set(SRCS
src/stb_image_write.c
)
add_library(stb ${SRCS})
target_include_directories(stb PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_include_directories(stb INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(stb Threads::Threads "${CMAKE_DL_LIBS}")

View file

@ -1,7 +1,13 @@
set(SRCS set(SRCS
audio.cpp audio.cpp
audio.h audio.h
audio_stream.cpp
audio_stream.h
bitfield.h bitfield.h
cd_image.cpp
cd_image.h
cd_xa.cpp
cd_xa.h
display.cpp display.cpp
display.h display.h
display_renderer.cpp display_renderer.cpp
@ -9,6 +15,10 @@ set(SRCS
display_timing.cpp display_timing.cpp
display_timing.h display_timing.h
fastjmp.h fastjmp.h
gl_program.cpp
gl_program.h
gl_texture.cpp
gl_texture.h
hdd_image.cpp hdd_image.cpp
hdd_image.h hdd_image.h
jit_code_buffer.cpp jit_code_buffer.cpp

View file

@ -1,16 +1,54 @@
add_library(core add_library(core
cpu_bus.cpp bus.cpp
cpu_bus.h bus.h
cpu_bus.inl bus.inl
cdrom.cpp
cdrom.h
cpu_core.cpp cpu_core.cpp
cpu_core.h cpu_core.h
cpu_core.inl cpu_core.inl
cpu_disasm.cpp
cpu_disasm.h
cpu_types.h
digital_controller.cpp
digital_controller.h
dma.cpp
dma.h
gpu.cpp
gpu.h
gpu_hw.cpp
gpu_hw.h
gpu_hw_opengl.cpp
gpu_hw_opengl.h
gte.cpp
gte.h
gte.inl
gte_types.h
host_interface.cpp
host_interface.h
interrupt_controller.cpp
interrupt_controller.h
mdec.cpp
mdec.h
memory_card.cpp
memory_card.h
pad.cpp
pad.h
pad_device.cpp
pad_device.h
save_state_version.h
settings.cpp
settings.h
spu.cpp
spu.h
system.cpp system.cpp
system.h system.h
timers.cpp
timers.h
types.h types.h
) )
target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_link_libraries(core Threads::Threads YBaseLib common) target_link_libraries(core Threads::Threads YBaseLib common imgui stb)

View file

@ -2,6 +2,8 @@ set(SRCS
main.cpp main.cpp
sdl_audio_mixer.cpp sdl_audio_mixer.cpp
sdl_audio_mixer.h sdl_audio_mixer.h
sdl_audio_stream.cpp
sdl_audio_stream.h
sdl_interface.cpp sdl_interface.cpp
sdl_interface.h sdl_interface.h
) )