diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index cac6683..5f4b3c1 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -33,6 +33,7 @@ #include #include +#undef inline #include #include diff --git a/binding-mri/binding-util.h b/binding-mri/binding-util.h index 2a7ab56..4f23867 100644 --- a/binding-mri/binding-util.h +++ b/binding-mri/binding-util.h @@ -23,6 +23,7 @@ #define BINDING_UTIL_H #include +#undef inline #include "exception.h" diff --git a/cmake/PrepUtils.cmake b/cmake/PrepUtils.cmake deleted file mode 100644 index 35bd9f6..0000000 --- a/cmake/PrepUtils.cmake +++ /dev/null @@ -1,38 +0,0 @@ -if(APPLE) - function(PostBuildMacBundle target framework_list lib_list) - INCLUDE(BundleUtilities) - GET_TARGET_PROPERTY(_BIN_NAME ${target} LOCATION) - GET_DOTAPP_DIR(${_BIN_NAME} _BUNDLE_DIR) - - set(_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${target}_prep.cmake") - file(WRITE ${_SCRIPT_FILE} - "# Generated Script file\n" - "include(BundleUtilities)\n" - "get_bundle_and_executable(\"\${BUNDLE_APP}\" bundle executable valid)\n" - "if(valid)\n" - " set(framework_dest \"\${bundle}/Contents/Frameworks\")\n" - " foreach(framework_path ${framework_list})\n" - " get_filename_component(framework_name \${framework_path} NAME_WE)\n" - " file(MAKE_DIRECTORY \"\${framework_dest}/\${framework_name}.framework/Versions/A/\")\n" - " copy_resolved_framework_into_bundle(\${framework_path}/Versions/A/\${framework_name} \${framework_dest}/\${framework_name}.framework/Versions/A/\${framework_name})\n" - " endforeach()\n" - " foreach(lib ${lib_list})\n" - " get_filename_component(lib_file \${lib} NAME)\n" - " copy_resolved_item_into_bundle(\${lib} \${framework_dest}/\${lib_file})\n" - " endforeach()\n" - "else()\n" - " message(ERROR \"App Not found? \${BUNDLE_APP}\")\n" - "endif()\n" - "#fixup_bundle(\"\${BUNDLE_APP}\" \"\" \"\${DEP_LIB_DIR}\")\n" - ) - - ADD_CUSTOM_COMMAND(TARGET ${target} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -DBUNDLE_APP="${_BUNDLE_DIR}" -P "${_SCRIPT_FILE}" - ) - endfunction() -else() - function(PostBuildMacBundle target framework_list lib_list) - # noop - endfunction() -endif() \ No newline at end of file diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..f2fb976 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,63 @@ +from conans import ConanFile, CMake, tools +import os.path + + +class MkxpConan(ConanFile): + name = "mkxp" + version = "0.0.0" + license = "GPLv2" + url = "https://github.com/elizagamedev/mkxp-oneshot" + description = "OneShot game runtime" + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + exports_sources = "*" + requires = ( + "boost/1.68.0@conan/stable", + "openal/1.18.2@bincrafters/stable", + "physfs/3.0.1@eliza/stable", + "pixman/0.34.0@eliza/stable", + "ruby-mkxp/2.5.1@eliza/stable", + "sdl2/2.0.8@bincrafters/stable", + "sdl2_image/2.0.3@bincrafters/stable", + "sdl2_ttf/2.0.14@eliza/stable", + "sdl_sound-mkxp/1.0.1@eliza/stable", + "sigc++/2.10.0@eliza/stable", + ) + default_options = ( + "boost:without_test=True", + "cygwin_installer:packages=xxd", + ) + + def build_requirements(self): + if tools.os_info.is_windows: + self.build_requires("cygwin_installer/2.9.0@bincrafters/stable") + + def build_configure(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def build(self): + if tools.os_info.is_windows: + cygwin_bin = self.deps_env_info["cygwin_installer"].CYGWIN_BIN + with tools.environment_append({"PATH": [cygwin_bin], + "CONAN_BASH_PATH": os.path.join(cygwin_bin, "bash.exe")}): + self.build_configure() + else: + self.build_configure() + + def package(self): + self.copy("*", dst="bin", src="bin") + + def imports(self): + self.do_copy_deps(self.copy) + + def deploy(self): + self.copy("*") + self.do_copy_deps(self.copy_deps) + + def do_copy_deps(self, copy): + deps = set(self.deps_cpp_info.deps) + deps.discard("cygwin_installer") + for dep in deps: + copy("*.dll", dst="bin", src="bin", root_package=dep, keep_path=False) diff --git a/src/filesystem.cpp b/src/filesystem.cpp index ebd7b4c..0ffd3a6 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -527,7 +527,7 @@ void FileSystem::initFontSets(SharedFontState &sfs) { FontSetsCBData d = { p, &sfs }; - PHYSFS_enumerate("Fonts", fontSetEnumCB, &d); + PHYSFS_enumerate(".", findFontsFolderCB, &d); } struct OpenReadEnumData diff --git a/src/graphics.cpp b/src/graphics.cpp index 5b6281a..8cd2132 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -44,7 +44,9 @@ #include #include +#ifndef _MSC_VER #include +#endif #include #include diff --git a/src/main.cpp b/src/main.cpp index 86800cd..0533e0a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,7 +26,12 @@ #include #include +#ifdef _MSC_VER +#include +#define _chdir chdir +#else #include +#endif #include #include #include diff --git a/src/sharedstate.cpp b/src/sharedstate.cpp index 7f4f455..d5e79fb 100644 --- a/src/sharedstate.cpp +++ b/src/sharedstate.cpp @@ -41,7 +41,9 @@ #include "binding.h" #include "exception.h" +#ifndef _MSC_VER #include +#endif #include #include