#320: added PRO build target

This commit is contained in:
Vadim Grigoruk 2018-06-30 14:03:20 +03:00
parent ba503ea3e3
commit f40f98a3c7
1 changed files with 51 additions and 39 deletions

View File

@ -382,19 +382,27 @@ set(TIC80LIB_SRC
${TIC80LIB_DIR}/html.c
)
add_library(tic80lib STATIC ${TIC80LIB_SRC} ${DEMO_CARTS_OUT})
set(TIC80_OUTPUTS tic80 tic80pro)
foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
add_library(${TIC80_OUTPUT}lib STATIC ${TIC80LIB_SRC} ${DEMO_CARTS_OUT})
if(WIN32)
target_include_directories(tic80lib PRIVATE 3rd-party/dirent)
target_include_directories(${TIC80_OUTPUT}lib PRIVATE 3rd-party/dirent)
endif()
target_include_directories(tic80lib PRIVATE include)
target_include_directories(tic80lib PRIVATE 3rd-party/giflib-5.1.4/lib)
target_include_directories(tic80lib PRIVATE 3rd-party/zlib-1.2.11)
target_include_directories(tic80lib PRIVATE 3rd-party/lua-5.3.1/src)
target_include_directories(${TIC80_OUTPUT}lib PRIVATE include)
target_include_directories(${TIC80_OUTPUT}lib PRIVATE 3rd-party/giflib-5.1.4/lib)
target_include_directories(${TIC80_OUTPUT}lib PRIVATE 3rd-party/zlib-1.2.11)
target_include_directories(${TIC80_OUTPUT}lib PRIVATE 3rd-party/lua-5.3.1/src)
add_dependencies(tic80lib tic80core zlib)
target_link_libraries(tic80lib tic80core zlib)
add_dependencies(${TIC80_OUTPUT}lib tic80core zlib)
target_link_libraries(${TIC80_OUTPUT}lib tic80core zlib)
endforeach(CART_FILE)
target_compile_definitions(tic80prolib PRIVATE TIC80_PRO)
################################
# TIC-80 app
@ -411,28 +419,30 @@ if(APPLE)
set(TIC80_SRC ${TIC80_SRC} ${TIC80_DIR}/ext/file_dialog.m)
endif()
foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
if(WIN32)
# TODO: uncomment this (temporary disabled for VS2017)
# set(TIC80_SRC ${TIC80_SRC} build/windows/tic80.rc)
add_executable(tic80 WIN32 ${TIC80_SRC})
add_executable(${TIC80_OUTPUT} WIN32 ${TIC80_SRC})
else()
add_executable(tic80 ${TIC80_SRC})
add_executable(${TIC80_OUTPUT} ${TIC80_SRC})
endif()
target_include_directories(tic80 PRIVATE include)
target_include_directories(tic80 PRIVATE 3rd-party/SDL2-2.0.7/include)
target_include_directories(tic80 PRIVATE 3rd-party/sdl-gpu/include)
target_include_directories(tic80 PRIVATE 3rd-party/SDL2_net-2.0.1)
target_include_directories(${TIC80_OUTPUT} PRIVATE include)
target_include_directories(${TIC80_OUTPUT} PRIVATE 3rd-party/SDL2-2.0.7/include)
target_include_directories(${TIC80_OUTPUT} PRIVATE 3rd-party/sdl-gpu/include)
target_include_directories(${TIC80_OUTPUT} PRIVATE 3rd-party/SDL2_net-2.0.1)
if(NOT EMSCRIPTEN)
add_dependencies(tic80 SDL2-static SDL2main)
target_link_libraries(tic80 SDL2-static SDL2main)
add_dependencies(${TIC80_OUTPUT} SDL2-static SDL2main)
target_link_libraries(${TIC80_OUTPUT} SDL2-static SDL2main)
endif()
add_dependencies(tic80 tic80lib sdlnet sdlgpu)
target_link_libraries(tic80 tic80lib sdlnet sdlgpu)
add_dependencies(${TIC80_OUTPUT} ${TIC80_OUTPUT}lib sdlnet sdlgpu)
target_link_libraries(${TIC80_OUTPUT} ${TIC80_OUTPUT}lib sdlnet sdlgpu)
if(LINUX)
include(FindPkgConfig)
@ -442,6 +452,8 @@ if(LINUX)
pkg_check_modules(GTK REQUIRED gtk+-3.0)
target_include_directories(tic80 PRIVATE ${GTK_INCLUDE_DIRS})
target_link_libraries(tic80 ${GTK_LIBRARIES})
target_include_directories(${TIC80_OUTPUT} PRIVATE ${GTK_INCLUDE_DIRS})
target_link_libraries(${TIC80_OUTPUT} ${GTK_LIBRARIES})
endif()
endforeach()