diff --git a/.gitignore b/.gitignore index c587f78..b94c17b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ bin build CMakeFiles cmake-build-* +x64 +obj +runtimes + diff --git a/YogaNative.sln b/YogaNative.sln new file mode 100644 index 0000000..89d3d45 --- /dev/null +++ b/YogaNative.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34112.27 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YogaBinding", "YogaNative.vcxproj", "{C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Debug|x64.ActiveCfg = Debug|x64 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Debug|x64.Build.0 = Debug|x64 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Debug|x86.ActiveCfg = Debug|Win32 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Debug|x86.Build.0 = Debug|Win32 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Release|x64.ActiveCfg = Release|x64 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Release|x64.Build.0 = Release|x64 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Release|x86.ActiveCfg = Release|Win32 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EF6F1713-A0E9-433B-957F-287B6096389D} + EndGlobalSection +EndGlobal diff --git a/YogaNative.vcxproj b/YogaNative.vcxproj new file mode 100644 index 0000000..bb746ac --- /dev/null +++ b/YogaNative.vcxproj @@ -0,0 +1,129 @@ + + + + false + false + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + {C5D3F6B0-1B8D-4F8A-9E9F-5C5E7E3F9E1A} + netstandard2.0 + ManagedCProj + YogaBinding + 10.0 + YogaBinding + true + v4.7.2 + + + + DynamicLibrary + v143 + Unicode + true + + + true + + + false + true + + + + yoga + $(SolutionDir)bin\$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Level3 + stdcpp20 + $(ProjectDir)src;$(ProjectDir)lib\yoga;$(ProjectDir)lib\yoga\yoga;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_USRDLL;YOGA_BINDING_EXPORTS;FB_ASSERTIONS_ENABLED=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + true + NotUsing + false + 4251 + false + MultiThreadedDebug + MultiThreaded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NO_NUGET_TARGETS + + \ No newline at end of file diff --git a/YogaNative.vcxproj.filters b/YogaNative.vcxproj.filters new file mode 100644 index 0000000..24fc1f7 --- /dev/null +++ b/YogaNative.vcxproj.filters @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/YogaNative.vcxproj.user b/YogaNative.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/YogaNative.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/bindings.h b/src/bindings.h index 32c39e6..b99f679 100644 --- a/src/bindings.h +++ b/src/bindings.h @@ -5,10 +5,18 @@ #include -#define EXPORT __attribute__((visibility("default"))) +#ifdef _MSC_VER +#ifdef YOGA_BINDING_EXPORTS +#define YOGA_API __declspec(dllexport) +#else +#define YOGA_API __declspec(dllimport) +#endif +#else +#define YOGA_API __attribute__((visibility("default"))) +#endif extern "C" { typedef void (* YGBindingsLogger)(YGLogLevel level, char* string); -EXPORT void YGBindingsConfigSetLogger(YGConfigRef config, YGBindingsLogger logger); +YOGA_API void YGBindingsConfigSetLogger(YGConfigRef config, YGBindingsLogger logger); }