diff --git a/README.md b/README.md index e36a29e9..38ae7b58 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This binding should support RGSS1, RGSS2 and RGSS3, though I've only tested it w ## Dependencies / Building -* ObjFW +* [ObjFW](https://github.com/ObjFW/ObjFW) * libsigc++ 2.0 * PhysFS (latest hg) * OpenAL @@ -29,7 +29,7 @@ This binding should support RGSS1, RGSS2 and RGSS3, though I've only tested it w * SDL2_image * SDL2_ttf * [Ancurio's SDL_sound fork](https://github.com/Ancurio/SDL_sound) -* [My Ruby 1.8 fork](https://github.com/inori-z/ruby/tree/ruby_1_8_7), for Zlib, a Windows build that doesn't segfault, and any 1.8.1 compatibility stuff +* [My Ruby 1.8 fork](https://github.com/inori-z/ruby/tree/ruby_1_8_7), if using Ruby 1.8 * vorbisfile * pixman * zlib (only ruby bindings) @@ -46,7 +46,7 @@ Midi support is enabled by default and requires fluidsynth to be present at runt By default, mkxp switches into the directory where its binary is contained and then starts reading the configuration and resolving relative paths. In case this is undesired (eg. when the binary is to be installed to a system global, read-only location), it can be turned off by adding `-Dworkdir_current=true` to meson's build arguments. -**MRI-Binding**: By default, meson will search for Ruby 1.8 libraries and includes within the system search path. This can be adjusted with `-Dcpp_args=-I[path]` for includes and `-Dcpp_link_args=-L[path]` for libraries. For newer Ruby versions, pkg-config will look for `ruby-X.Y.pc`, where `X` is the major version number and `Y` is the minor version number (e.g. `ruby-2.6.pc`). The version that will be searched for can be set with `-Dmri_version=X.Y` (`-Dmri_version=2.6` as an example). +**MRI-Binding**: Meson will use pkg-config to look for `ruby-X.Y.pc`, where `X` is the major version number and `Y` is the minor version number (e.g. `ruby-2.5.pc`). The version that will be searched for can be set with `-Dmri_version=X.Y`. `mri-version` is set to `1.8` by default. ## Supported image/audio formats diff --git a/binding/meson.build b/binding/meson.build index 285f68ff..75abda5d 100644 --- a/binding/meson.build +++ b/binding/meson.build @@ -1,12 +1,9 @@ ver = get_option('mri_version') -if ver.version_compare('>1.8') == true - global_dependencies += dependency('ruby-' + ver) -else - lib = get_option('ruby_lib') - global_dependencies += compilers['cpp'].find_library(lib) +if ver.version_compare('>1.8') == false add_project_arguments('-DOLD_RUBY', language: ['cpp','objc','objcpp']) endif +global_dependencies += dependency('ruby-' + ver) if get_option('no_preload_scripts') == true add_project_arguments('-DNO_PRELOAD_SCRIPTS', language: ['cpp','objc','objcpp']) @@ -40,4 +37,4 @@ if discord == true binding_source += files('discord-binding.cpp') endif -global_sources += binding_source \ No newline at end of file +global_sources += binding_source diff --git a/binding/miniffi-binding.cpp b/binding/miniffi-binding.cpp index 1b258dd8..759b1a5a 100644 --- a/binding/miniffi-binding.cpp +++ b/binding/miniffi-binding.cpp @@ -2,9 +2,7 @@ // it's just as basic but should work fine for the moment #include -#ifdef USE_FAKEAPI #include "fake-api.h" -#endif #include "binding-util.h" diff --git a/src/fake-api.h b/src/fake-api.h index e7b59698..3736bf53 100644 --- a/src/fake-api.h +++ b/src/fake-api.h @@ -1,9 +1,5 @@ #pragma once -#ifdef __WIN32__ -#include -#endif - #define ABI(x) __attribute__((x)) #if defined(__WIN32__) #define PREFABI ABI(stdcall) @@ -11,6 +7,12 @@ #define PREFABI #endif +#ifdef USE_FAKEAPI + +#ifdef __WIN32__ +#include +#endif + #ifndef __WIN32__ typedef unsigned int DWORD, UINT, *LPDWORD; typedef char BYTE, *LPSTR, *LPCSTR, *LPCTSTR, *LPTSTR, *PBYTE; @@ -151,3 +153,4 @@ PREFABI BOOL MKXP_GetUserName(LPSTR lpBuffer, LPDWORD pcbBuffer); #endif +#endif \ No newline at end of file