38 lines
1.1 KiB
CMake
38 lines
1.1 KiB
CMake
set(inc "inc")
|
|
|
|
if(PS1_BUILD)
|
|
set(src
|
|
"ps1/src/sound.c")
|
|
set(inc ${inc} "ps1/inc")
|
|
set(privdeps system)
|
|
elseif(SDL1_2_BUILD)
|
|
set(src
|
|
"sdl-1.2/src/sound.c")
|
|
set(inc ${inc} "sdl-1.2/inc")
|
|
set(deps ${deps} SDL_mixer)
|
|
set(privdeps ${privdeps} SDL header)
|
|
endif()
|
|
|
|
add_library(sfx ${src})
|
|
target_include_directories(sfx PUBLIC ${inc})
|
|
target_include_directories(sfx PRIVATE ${privinc})
|
|
target_link_libraries(sfx PUBLIC ${deps} PRIVATE ${privdeps})
|
|
|
|
if(PS1_BUILD)
|
|
set(modes VMODE_PAL VMODE_NTSC)
|
|
|
|
if(VIDEO_MODE)
|
|
if(NOT "${VIDEO_MODE}" IN_LIST modes)
|
|
message(FATAL_ERROR "Invalid video mode ${VIDEO_MODE}. Available options:\n"
|
|
"${modes}\n"
|
|
"Run CMake again using one of the available video modes e.g.: cmake .. -DVIDEO_MODE=VMODE_PAL")
|
|
endif()
|
|
|
|
target_compile_definitions(sfx PRIVATE VIDEO_MODE=${VIDEO_MODE})
|
|
else()
|
|
message(FATAL_ERROR "Please define video mode. Available options:\n"
|
|
"${modes}\n"
|
|
"Run CMake again using one of the available video modes e.g.: cmake .. -DVIDEO_MODE=VMODE_PAL")
|
|
endif()
|
|
endif()
|