mirror of https://github.com/mgba-emu/mgba.git
Don't require SDL for perf builds
This commit is contained in:
parent
968dbe55db
commit
b4b7be1f84
|
@ -14,16 +14,21 @@ include_directories(${CMAKE_SOURCE_DIR}/src/gba)
|
|||
include_directories(${CMAKE_SOURCE_DIR}/src/debugger)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/util)
|
||||
|
||||
find_package(SDL 1.2 REQUIRED)
|
||||
file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-*.c)
|
||||
if(WIN32)
|
||||
add_definitions(-D_WIN32_WINNT=0x0600)
|
||||
file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/windows/*.c)
|
||||
else()
|
||||
add_definitions(-DUSE_PTHREADS)
|
||||
set(PLATFORM_LIBRARY "${PLATFORM_LIBRARY};pthread")
|
||||
file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/posix/*.c)
|
||||
endif()
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/platform/sdl)
|
||||
|
||||
if(NOT BUILD_PERF)
|
||||
find_package(SDL 1.2 REQUIRED)
|
||||
file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-*.c)
|
||||
set(PLATFORM_LIBRARY "${SDL_LIBRARY};${SDLMAIN_LIBRARY}")
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/platform/sdl)
|
||||
endif()
|
||||
|
||||
if(USE_DEBUGGER)
|
||||
file(GLOB DEBUGGER_SRC ${CMAKE_SOURCE_DIR}/src/debugger/*.c)
|
||||
|
@ -57,4 +62,4 @@ if(BUILD_PERF)
|
|||
endif()
|
||||
|
||||
add_executable(${BINARY_NAME} WIN32 ${ARM_SRC} ${GBA_SRC} ${DEBUGGER_SRC} ${RENDERER_SRC} ${UTIL_SRC} ${PLATFORM_SRC} ${OS_SRC} ${MAIN_SRC})
|
||||
target_link_libraries(${BINARY_NAME} m ${DEBUGGER_LIB} ${SDL_LIBRARY} ${SDLMAIN_LIBRARY} ${OPENGL_LIBRARY} ${EXTRA_LIB})
|
||||
target_link_libraries(${BINARY_NAME} m ${DEBUGGER_LIB} ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${EXTRA_LIB})
|
||||
|
|
Loading…
Reference in New Issue