2013-12-31 21:24:14 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.11)
|
|
|
|
Project(mkxp)
|
|
|
|
|
2013-12-31 21:36:00 +00:00
|
|
|
## Setup options ##
|
|
|
|
|
2014-09-07 03:23:10 +00:00
|
|
|
option(SHARED_FLUID "Dynamically link fluidsynth at build time" OFF)
|
2014-08-02 07:30:17 +00:00
|
|
|
option(WORKDIR_CURRENT "Keep current directory on startup" OFF)
|
2013-12-31 21:36:00 +00:00
|
|
|
option(FORCE32 "Force 32bit compile on 64bit OS" OFF)
|
2020-05-04 07:44:08 +00:00
|
|
|
set(BINDING "MRUBY" CACHE STRING "The Binding Type (MRI, MRUBY, NULL)")
|
2013-12-31 21:36:00 +00:00
|
|
|
set(EXTERNAL_LIB_PATH "" CACHE PATH "External precompiled lib prefix")
|
|
|
|
|
2013-12-31 21:24:14 +00:00
|
|
|
## Misc setup ##
|
|
|
|
|
|
|
|
include(cmake/PrepUtils.cmake)
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
IF("${CMAKE_SYSTEM}" MATCHES "Linux")
|
2014-01-01 15:46:33 +00:00
|
|
|
SET(LINUX ON)
|
2013-12-31 21:24:14 +00:00
|
|
|
ENDIF()
|
|
|
|
|
2014-08-02 07:30:17 +00:00
|
|
|
IF(WORKDIR_CURRENT)
|
|
|
|
list(APPEND DEFINES
|
|
|
|
WORKDIR_CURRENT
|
|
|
|
)
|
|
|
|
ENDIF()
|
|
|
|
|
2013-12-31 21:24:14 +00:00
|
|
|
IF(FORCE32)
|
2014-01-01 15:46:33 +00:00
|
|
|
if(APPLE)
|
|
|
|
SET(CMAKE_OSX_ARCHITECTURES "i386")
|
|
|
|
else()
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
|
|
|
endif()
|
2013-12-31 21:24:14 +00:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
|
|
|
|
|
|
|
IF(LINUX)
|
2014-01-01 15:46:33 +00:00
|
|
|
if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT(FORCE32) )
|
|
|
|
set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86_64")
|
|
|
|
set(BIN_RPATH "\$ORIGIN/lib64")
|
2014-01-01 19:54:19 +00:00
|
|
|
set(LIB_PATH "lib64")
|
2014-01-01 15:46:33 +00:00
|
|
|
else()
|
|
|
|
set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86")
|
|
|
|
set(BIN_RPATH "\$ORIGIN/lib")
|
2014-01-01 19:54:19 +00:00
|
|
|
set(LIB_PATH "lib")
|
2014-01-01 15:46:33 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64")
|
|
|
|
endif()
|
2013-12-31 21:24:14 +00:00
|
|
|
elseif(APPLE)
|
2014-01-01 15:46:33 +00:00
|
|
|
SET(BIN_RPATH "@executable_path/../Frameworks")
|
2014-01-01 19:54:19 +00:00
|
|
|
set(LIB_PATH "lib")
|
2013-12-31 21:24:14 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
|
|
|
set(CMAKE_INSTALL_RPATH ${BIN_RPATH})
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
|
|
|
|
|
|
|
|
## Locate core libs ##
|
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
|
|
|
if (EXTERNAL_LIB_PATH)
|
2014-01-01 15:46:33 +00:00
|
|
|
set(CMAKE_PREFIX_PATH ${EXTERNAL_LIB_PATH})
|
2014-01-01 19:54:19 +00:00
|
|
|
|
|
|
|
if(EXISTS "${EXTERNAL_LIB_PATH}/${LIB_PATH}/pkgconfig/")
|
|
|
|
SET(ENV{PKG_CONFIG_PATH} "${EXTERNAL_LIB_PATH}/${LIB_PATH}/pkgconfig/")
|
2014-01-01 15:46:33 +00:00
|
|
|
endif()
|
|
|
|
if(APPLE)
|
|
|
|
set(PLATFORM_SHARED_LIBS
|
|
|
|
libSDL2.dylib libSDL2_image-2.0.0.dylib libSDL2_ttf-2.0.0.dylib libSDL_sound-1.0.1.dylib
|
|
|
|
libfreetype.6.dylib libsigc-2.0.0.dylib
|
|
|
|
CACHE STRING "List of shared libraries that need to be copied into the OS X bundle")
|
|
|
|
foreach(lib ${PLATFORM_SHARED_LIBS})
|
|
|
|
if(EXISTS ${EXTERNAL_LIB_PATH}/lib/${lib})
|
|
|
|
list(APPEND PLATFORM_COPY_LIBS
|
|
|
|
${EXTERNAL_LIB_PATH}/lib/${lib}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2013-12-31 21:24:14 +00:00
|
|
|
endif()
|
|
|
|
|
2020-05-04 07:44:08 +00:00
|
|
|
#pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
|
|
|
#pkg_check_modules(SDL2 REQUIRED sdl2)
|
|
|
|
#pkg_check_modules(SDL2_TTF REQUIRED SDL2_ttf)
|
|
|
|
#pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)
|
|
|
|
#find_package(OpenAL REQUIRED)
|
|
|
|
#find_package(ZLIB REQUIRED)
|
2013-12-31 21:24:14 +00:00
|
|
|
|
|
|
|
## Setup main source ##
|
|
|
|
|
|
|
|
set(MAIN_HEADERS
|
2014-01-01 15:46:33 +00:00
|
|
|
src/quadarray.h
|
2013-12-31 21:24:14 +00:00
|
|
|
src/audio.h
|
|
|
|
src/binding.h
|
|
|
|
src/bitmap.h
|
|
|
|
src/disposable.h
|
|
|
|
src/etc.h
|
|
|
|
src/etc-internal.h
|
|
|
|
src/eventthread.h
|
|
|
|
src/flashable.h
|
|
|
|
src/font.h
|
|
|
|
src/input.h
|
2018-09-25 17:58:10 +00:00
|
|
|
src/iniconfig.h
|
2013-12-31 21:24:14 +00:00
|
|
|
src/plane.h
|
|
|
|
src/scene.h
|
|
|
|
src/sprite.h
|
|
|
|
src/table.h
|
|
|
|
src/texpool.h
|
|
|
|
src/tilequad.h
|
|
|
|
src/transform.h
|
|
|
|
src/viewport.h
|
|
|
|
src/window.h
|
|
|
|
src/serializable.h
|
|
|
|
src/shader.h
|
|
|
|
src/glstate.h
|
|
|
|
src/quad.h
|
|
|
|
src/tilemap.h
|
2014-11-30 16:46:28 +00:00
|
|
|
src/tilemap-common.h
|
2013-12-31 21:24:14 +00:00
|
|
|
src/graphics.h
|
2014-11-29 16:47:40 +00:00
|
|
|
src/gl-debug.h
|
2013-12-31 21:24:14 +00:00
|
|
|
src/global-ibo.h
|
|
|
|
src/exception.h
|
|
|
|
src/filesystem.h
|
|
|
|
src/serial-util.h
|
|
|
|
src/intrulist.h
|
|
|
|
src/binding.h
|
|
|
|
src/gl-util.h
|
|
|
|
src/util.h
|
|
|
|
src/config.h
|
2014-01-25 08:24:55 +00:00
|
|
|
src/settingsmenu.h
|
|
|
|
src/keybindings.h
|
2013-12-31 21:24:14 +00:00
|
|
|
src/tileatlas.h
|
|
|
|
src/sharedstate.h
|
|
|
|
src/al-util.h
|
2014-01-01 15:46:33 +00:00
|
|
|
src/boost-hash.h
|
2013-12-31 21:24:14 +00:00
|
|
|
src/debugwriter.h
|
2014-05-30 21:01:35 +00:00
|
|
|
src/gl-fun.h
|
2014-07-13 20:18:27 +00:00
|
|
|
src/gl-meta.h
|
|
|
|
src/vertex.h
|
2014-07-23 15:28:20 +00:00
|
|
|
src/soundemitter.h
|
|
|
|
src/aldatasource.h
|
|
|
|
src/alstream.h
|
|
|
|
src/audiostream.h
|
2014-07-23 20:57:39 +00:00
|
|
|
src/rgssad.h
|
2014-08-28 21:11:10 +00:00
|
|
|
src/windowvx.h
|
|
|
|
src/tilemapvx.h
|
|
|
|
src/tileatlasvx.h
|
2014-09-07 03:23:10 +00:00
|
|
|
src/sharedmidistate.h
|
|
|
|
src/fluid-fun.h
|
2014-09-30 07:13:12 +00:00
|
|
|
src/sdl-util.h
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(MAIN_SOURCE
|
|
|
|
src/main.cpp
|
|
|
|
src/audio.cpp
|
|
|
|
src/bitmap.cpp
|
2020-05-04 12:29:12 +00:00
|
|
|
src/emscripten.cpp
|
2013-12-31 21:24:14 +00:00
|
|
|
src/eventthread.cpp
|
|
|
|
src/filesystem.cpp
|
|
|
|
src/font.cpp
|
|
|
|
src/input.cpp
|
2018-09-25 17:58:10 +00:00
|
|
|
src/iniconfig.cpp
|
2013-12-31 21:24:14 +00:00
|
|
|
src/plane.cpp
|
|
|
|
src/scene.cpp
|
|
|
|
src/sprite.cpp
|
|
|
|
src/table.cpp
|
|
|
|
src/tilequad.cpp
|
|
|
|
src/viewport.cpp
|
|
|
|
src/window.cpp
|
|
|
|
src/texpool.cpp
|
|
|
|
src/shader.cpp
|
|
|
|
src/glstate.cpp
|
|
|
|
src/tilemap.cpp
|
|
|
|
src/autotiles.cpp
|
|
|
|
src/graphics.cpp
|
2014-11-29 16:47:40 +00:00
|
|
|
src/gl-debug.cpp
|
2013-12-31 21:24:14 +00:00
|
|
|
src/etc.cpp
|
|
|
|
src/config.cpp
|
2014-01-25 08:24:55 +00:00
|
|
|
src/settingsmenu.cpp
|
|
|
|
src/keybindings.cpp
|
2013-12-31 21:24:14 +00:00
|
|
|
src/tileatlas.cpp
|
|
|
|
src/sharedstate.cpp
|
2014-05-30 21:01:35 +00:00
|
|
|
src/gl-fun.cpp
|
2014-07-13 20:18:27 +00:00
|
|
|
src/gl-meta.cpp
|
|
|
|
src/vertex.cpp
|
2014-07-23 15:28:20 +00:00
|
|
|
src/soundemitter.cpp
|
|
|
|
src/sdlsoundsource.cpp
|
|
|
|
src/alstream.cpp
|
|
|
|
src/audiostream.cpp
|
2014-07-23 20:57:39 +00:00
|
|
|
src/rgssad.cpp
|
2014-08-16 21:20:33 +00:00
|
|
|
src/bundledfont.cpp
|
2014-08-28 21:11:10 +00:00
|
|
|
src/vorbissource.cpp
|
|
|
|
src/windowvx.cpp
|
|
|
|
src/tilemapvx.cpp
|
|
|
|
src/tileatlasvx.cpp
|
|
|
|
src/autotilesvx.cpp
|
2014-09-07 03:23:10 +00:00
|
|
|
src/midisource.cpp
|
|
|
|
src/fluid-fun.cpp
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
2017-05-25 09:39:45 +00:00
|
|
|
if(WIN32)
|
2017-08-18 17:06:11 +00:00
|
|
|
list(APPEND MAIN_HEADERS windows/resource.h)
|
2017-07-22 21:50:50 +00:00
|
|
|
list(APPEND MAIN_SOURCE windows/resource.rc)
|
2017-05-25 09:39:45 +00:00
|
|
|
endif()
|
|
|
|
|
2014-01-01 16:19:31 +00:00
|
|
|
source_group("MKXP Source" FILES ${MAIN_SOURCE} ${MAIN_HEADERS})
|
|
|
|
|
2013-12-31 21:24:14 +00:00
|
|
|
## Setup embedded source ##
|
|
|
|
|
|
|
|
set(EMBEDDED_INPUT
|
2014-12-23 17:33:33 +00:00
|
|
|
shader/common.h
|
2014-01-01 15:46:33 +00:00
|
|
|
shader/transSimple.frag
|
|
|
|
shader/trans.frag
|
|
|
|
shader/hue.frag
|
|
|
|
shader/sprite.frag
|
|
|
|
shader/plane.frag
|
2014-12-23 17:56:00 +00:00
|
|
|
shader/gray.frag
|
2014-01-01 15:46:33 +00:00
|
|
|
shader/bitmapBlit.frag
|
2014-12-23 17:56:00 +00:00
|
|
|
shader/flatColor.frag
|
2014-01-01 15:46:33 +00:00
|
|
|
shader/simple.frag
|
|
|
|
shader/simpleColor.frag
|
|
|
|
shader/simpleAlpha.frag
|
2014-12-23 16:52:32 +00:00
|
|
|
shader/simpleAlphaUni.frag
|
2014-01-01 15:46:33 +00:00
|
|
|
shader/flashMap.frag
|
2014-12-23 17:56:00 +00:00
|
|
|
shader/minimal.vert
|
2014-01-01 15:46:33 +00:00
|
|
|
shader/simple.vert
|
|
|
|
shader/simpleColor.vert
|
|
|
|
shader/sprite.vert
|
2014-07-09 15:11:05 +00:00
|
|
|
shader/tilemap.vert
|
2014-09-29 23:34:10 +00:00
|
|
|
shader/tilemapvx.vert
|
2014-08-28 21:11:10 +00:00
|
|
|
shader/blur.frag
|
|
|
|
shader/blurH.vert
|
|
|
|
shader/blurV.vert
|
|
|
|
shader/simpleMatrix.vert
|
2014-01-01 15:46:33 +00:00
|
|
|
assets/liberation.ttf
|
2014-11-29 16:23:42 +00:00
|
|
|
assets/icon.png
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if (RGSS2)
|
2014-07-25 13:19:10 +00:00
|
|
|
list(APPEND DEFINES
|
|
|
|
RGSS2
|
|
|
|
)
|
2013-12-31 21:24:14 +00:00
|
|
|
endif()
|
|
|
|
|
2014-09-07 03:23:10 +00:00
|
|
|
if (SHARED_FLUID)
|
|
|
|
pkg_check_modules(FLUID REQUIRED fluidsynth)
|
2014-07-31 01:32:07 +00:00
|
|
|
list(APPEND DEFINES
|
2014-09-07 03:23:10 +00:00
|
|
|
SHARED_FLUID
|
2014-07-31 01:32:07 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2013-12-31 21:24:14 +00:00
|
|
|
## Process Embeddeds ##
|
|
|
|
|
|
|
|
find_program(XXD_EXE xxd
|
2014-01-01 15:46:33 +00:00
|
|
|
DOC "Location of the xxd executable"
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
macro(ProcessWithXXD outvar inputfile outdir)
|
2014-01-01 15:46:33 +00:00
|
|
|
get_filename_component(basefile ${inputfile} NAME)
|
|
|
|
set(outputfile ${outdir}/${basefile}.xxd)
|
|
|
|
set_source_files_properties(${outputfile} PROPERTIES HEADER_ONLY TRUE)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${outputfile}
|
|
|
|
COMMAND ${XXD_EXE} -i ${inputfile} ${outputfile}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
DEPENDS ${inputfile}
|
|
|
|
COMMENT "Generating XXD for ${inputfile}"
|
|
|
|
)
|
|
|
|
list(APPEND ${outvar}
|
|
|
|
${outputfile}
|
|
|
|
)
|
2013-12-31 21:24:14 +00:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xxdhack)
|
|
|
|
include_directories(
|
2014-01-01 15:46:33 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/xxdhack
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
foreach(item ${EMBEDDED_INPUT})
|
2014-01-01 15:46:33 +00:00
|
|
|
ProcessWithXXD(EMBEDDED_SOURCE ${item} ${CMAKE_CURRENT_BINARY_DIR})
|
2013-12-31 21:24:14 +00:00
|
|
|
endforeach()
|
|
|
|
|
2014-01-01 16:19:31 +00:00
|
|
|
source_group("Embedded Source" FILES ${EMBEDDED_INPUT} ${EMBEDDED_SOURCE})
|
|
|
|
|
2013-12-31 21:24:14 +00:00
|
|
|
## Setup binding source ##
|
|
|
|
|
|
|
|
if (BINDING STREQUAL "MRI")
|
2014-10-03 18:15:52 +00:00
|
|
|
set(MRIVERSION "2.1" CACHE STRING "Version of MRI to link with")
|
2014-01-01 15:46:33 +00:00
|
|
|
list(APPEND DEFINES
|
|
|
|
BINDING_MRI
|
|
|
|
)
|
|
|
|
set(BINDING_HEADERS
|
|
|
|
binding-mri/binding-util.h
|
|
|
|
binding-mri/binding-types.h
|
|
|
|
binding-mri/serializable-binding.h
|
|
|
|
binding-mri/disposable-binding.h
|
|
|
|
binding-mri/sceneelement-binding.h
|
|
|
|
binding-mri/viewportelement-binding.h
|
|
|
|
binding-mri/flashable-binding.h
|
|
|
|
)
|
|
|
|
set(BINDING_SOURCE
|
|
|
|
binding-mri/binding-mri.cpp
|
|
|
|
binding-mri/binding-util.cpp
|
|
|
|
binding-mri/table-binding.cpp
|
|
|
|
binding-mri/etc-binding.cpp
|
|
|
|
binding-mri/bitmap-binding.cpp
|
|
|
|
binding-mri/font-binding.cpp
|
|
|
|
binding-mri/graphics-binding.cpp
|
|
|
|
binding-mri/input-binding.cpp
|
|
|
|
binding-mri/sprite-binding.cpp
|
|
|
|
binding-mri/viewport-binding.cpp
|
|
|
|
binding-mri/plane-binding.cpp
|
|
|
|
binding-mri/window-binding.cpp
|
|
|
|
binding-mri/tilemap-binding.cpp
|
|
|
|
binding-mri/audio-binding.cpp
|
|
|
|
binding-mri/module_rpg.cpp
|
|
|
|
binding-mri/filesystem-binding.cpp
|
2014-08-28 21:11:10 +00:00
|
|
|
binding-mri/windowvx-binding.cpp
|
|
|
|
binding-mri/tilemapvx-binding.cpp
|
2014-01-01 15:46:33 +00:00
|
|
|
)
|
2013-12-31 21:24:14 +00:00
|
|
|
elseif(BINDING STREQUAL "MRUBY")
|
2014-01-01 15:46:33 +00:00
|
|
|
list(APPEND DEFINES
|
|
|
|
BINDING_MRUBY
|
|
|
|
)
|
|
|
|
set(BINDING_HEADERS
|
|
|
|
binding-mruby/binding-util.h
|
|
|
|
binding-mruby/disposable-binding.h
|
|
|
|
binding-mruby/flashable-binding.h
|
|
|
|
binding-mruby/binding-types.h
|
|
|
|
binding-mruby/sceneelement-binding.h
|
|
|
|
binding-mruby/viewportelement-binding.h
|
|
|
|
binding-mruby/serializable-binding.h
|
|
|
|
binding-mruby/mrb-ext/rwmem.h
|
|
|
|
)
|
|
|
|
set(BINDING_SOURCE
|
|
|
|
binding-mruby/binding-mruby.cpp
|
|
|
|
binding-mruby/binding-util.cpp
|
|
|
|
binding-mruby/window-binding.cpp
|
|
|
|
binding-mruby/bitmap-binding.cpp
|
|
|
|
binding-mruby/sprite-binding.cpp
|
|
|
|
binding-mruby/font-binding.cpp
|
|
|
|
binding-mruby/viewport-binding.cpp
|
|
|
|
binding-mruby/plane-binding.cpp
|
|
|
|
binding-mruby/audio-binding.cpp
|
|
|
|
binding-mruby/tilemap-binding.cpp
|
|
|
|
binding-mruby/etc-binding.cpp
|
|
|
|
binding-mruby/graphics-binding.cpp
|
|
|
|
binding-mruby/input-binding.cpp
|
|
|
|
binding-mruby/table-binding.cpp
|
2020-05-04 07:44:08 +00:00
|
|
|
binding-mruby/mrb-ext/file-helper.cpp
|
2014-01-01 15:46:33 +00:00
|
|
|
binding-mruby/mrb-ext/rwmem.cpp
|
|
|
|
binding-mruby/mrb-ext/kernel.cpp
|
|
|
|
)
|
2013-12-31 21:24:14 +00:00
|
|
|
elseif(BINDING STREQUAL "NULL")
|
2014-01-01 15:46:33 +00:00
|
|
|
set(BINDING_SOURCE
|
|
|
|
binding-null/binding-null.cpp
|
|
|
|
)
|
2013-12-31 21:24:14 +00:00
|
|
|
else()
|
2014-01-01 15:46:33 +00:00
|
|
|
message(FATAL_ERROR "Must choose a valid binding type. MRI, MRUBY, or NULL")
|
2013-12-31 21:24:14 +00:00
|
|
|
endif()
|
|
|
|
|
2014-01-01 16:19:31 +00:00
|
|
|
source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS})
|
|
|
|
|
2013-12-31 21:24:14 +00:00
|
|
|
## Setup main executable ##
|
|
|
|
|
|
|
|
if(APPLE)
|
2014-01-01 15:46:33 +00:00
|
|
|
find_library(CARBON_LIBRARY Carbon)
|
|
|
|
find_library(IOKIT_LIBRARY IOKit)
|
|
|
|
mark_as_advanced(CARBON_LIBRARY IOKIT_LIBRARY)
|
|
|
|
list(APPEND PLATFORM_LIBRARIES
|
|
|
|
${CARBON_LIBRARY}
|
|
|
|
${IOKIT_LIBRARY}
|
2014-09-30 12:17:33 +00:00
|
|
|
"-liconv"
|
2014-01-01 15:46:33 +00:00
|
|
|
)
|
2013-12-31 21:24:14 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
link_directories(
|
2020-05-04 07:44:08 +00:00
|
|
|
../libsigc++-2.10.3/sigc++/.libs
|
|
|
|
../pixman-0.40.0/pixman/.libs
|
|
|
|
../physfs-3.0.2
|
|
|
|
../ruby
|
|
|
|
#../mruby/build/host/lib
|
|
|
|
../mruby/build/x86_64-pc-linux-gnu/lib
|
|
|
|
libs
|
|
|
|
|
2020-05-06 11:54:03 +00:00
|
|
|
#../SDL_sound/.libs
|
2020-05-04 07:44:08 +00:00
|
|
|
${SDL2_LIBRARY_DIRS}
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} MACOSX_BUNDLE
|
2014-01-01 15:46:33 +00:00
|
|
|
${MAIN_HEADERS}
|
|
|
|
${MAIN_SOURCE}
|
2014-01-01 16:19:31 +00:00
|
|
|
${BINDING_HEADERS}
|
2014-01-01 15:46:33 +00:00
|
|
|
${BINDING_SOURCE}
|
|
|
|
${EMBEDDED_SOURCE}
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
2014-01-01 15:46:33 +00:00
|
|
|
${DEFINES}
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
2014-01-01 15:46:33 +00:00
|
|
|
src
|
2017-07-22 21:50:50 +00:00
|
|
|
windows
|
2020-05-04 07:44:08 +00:00
|
|
|
../libsigc++-2.10.3
|
|
|
|
../pixman-0.40.0/pixman
|
|
|
|
../physfs-3.0.2/src
|
|
|
|
../mruby/include
|
2020-05-06 11:54:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
#../SDL_sound
|
2020-05-04 07:44:08 +00:00
|
|
|
|
|
|
|
${SDL2_INCLUDE_DIRS}
|
|
|
|
#${VORBISFILE_INCLUDE_DIRS}
|
2014-09-07 03:23:10 +00:00
|
|
|
${FLUID_INCLUDE_DIRS}
|
2014-01-01 15:46:33 +00:00
|
|
|
${OPENAL_INCLUDE_DIR}
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
2020-05-04 07:44:08 +00:00
|
|
|
#ruby-static.a
|
|
|
|
|
2020-05-06 11:54:03 +00:00
|
|
|
sigc-2.0.a physfs.a pixman-1.a
|
2020-05-05 12:13:37 +00:00
|
|
|
#sigc-2.0.x86.a physfs.x86.a SDL_sound.x86.a pixman-1.x86.a
|
2020-05-04 21:39:19 +00:00
|
|
|
|
2020-05-04 07:44:08 +00:00
|
|
|
mruby.a
|
|
|
|
|
2020-05-06 11:54:03 +00:00
|
|
|
#SDL_sound.a
|
2020-05-04 07:44:08 +00:00
|
|
|
#ruby-static.x86.a
|
|
|
|
#crypt
|
|
|
|
#dl
|
2020-05-04 20:07:18 +00:00
|
|
|
#pthread
|
|
|
|
#rt
|
2020-05-04 07:44:08 +00:00
|
|
|
|
2014-01-01 15:46:33 +00:00
|
|
|
${SDL2_LIBRARIES}
|
|
|
|
${SDL2_IMAGE_LIBRARIES}
|
|
|
|
${SDL2_TTF_LIBRARIES}
|
|
|
|
${SDL_SOUND_LIBRARIES}
|
|
|
|
${PHYSFS_LIBRARIES}
|
|
|
|
${PIXMAN_LIBRARIES}
|
|
|
|
${Boost_LIBRARIES}
|
2014-08-28 21:11:10 +00:00
|
|
|
${VORBISFILE_LIBRARIES}
|
2014-09-07 03:23:10 +00:00
|
|
|
${FLUID_LIBRARIES}
|
2014-01-01 15:46:33 +00:00
|
|
|
${OPENAL_LIBRARY}
|
|
|
|
${ZLIB_LIBRARY}
|
|
|
|
|
|
|
|
${PLATFORM_LIBRARIES}
|
2013-12-31 21:24:14 +00:00
|
|
|
)
|
|
|
|
|
2020-05-05 12:13:37 +00:00
|
|
|
SET(EMS_FLAGS " -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s USE_ZLIB=1 -s USE_OGG=1 -s USE_VORBIS=1 -s USE_SDL_TTF=2 --std=c++14 -O3 -g0")
|
2020-05-04 20:07:18 +00:00
|
|
|
SET(ASYNCIFY "-s ASYNCIFY=1 -s 'ASYNCIFY_IMPORTS=[\"load_file_async_js\"]'")
|
2020-05-04 07:44:08 +00:00
|
|
|
#SET(ERR_FLAGS " -Werror")
|
|
|
|
|
2020-05-04 20:07:18 +00:00
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EMS_FLAGS} ${ERR_FLAGS} ${ASYNCIFY}")
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EMS_FLAGS} ${ERR_FLAGS} ${ASYNCIFY}")
|
2020-05-05 12:31:13 +00:00
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EMS_FLAGS} ${ASYNCIFY} -s INITIAL_MEMORY=536870912 -lopenal --preload-file game -s DISABLE_EXCEPTION_CATCHING=1 -s ASSERTIONS=0 -s SAFE_HEAP=0 -s MINIFY_HTML=0 --shell-file shell.html -s EMULATE_FUNCTION_POINTER_CASTS=0 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2")
|
2020-05-04 07:44:08 +00:00
|
|
|
|
|
|
|
set_target_properties(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "mkxp"
|
|
|
|
SUFFIX ".html"
|
|
|
|
# SUFFIX ".out"
|
|
|
|
)
|
|
|
|
|
2013-12-31 21:24:14 +00:00
|
|
|
PostBuildMacBundle(${PROJECT_NAME} "" "${PLATFORM_COPY_LIBS}")
|