Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions vnext/Chakra/ChakraHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ bool fwrite(const T& val, FILE* file) noexcept
return fwrite(&val, 1, file) == 1;
}

#if !defined(CHAKRACOREUWP)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to suggest making the define CHAKRACORE_UWP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops. did catch this comment before the automerge. I'll send a follow-up renaming this

struct FileVersionInfoResource
{
uint16_t len;
Expand All @@ -59,7 +60,7 @@ struct FileVersionInfoResource
VS_FIXEDFILEINFO fixedFileInfo;
uint32_t padding2;
};

#endif
class ChakraVersionInfo
{
public:
Expand All @@ -73,6 +74,7 @@ class ChakraVersionInfo

bool initialize() noexcept
{
#if !defined(CHAKRACOREUWP)
// This code is win32 only at the moment. We will need to change this
// line if we want to support UWP.
constexpr wchar_t chakraDllName[] = L"ChakraCore.dll";
Expand Down Expand Up @@ -107,7 +109,7 @@ class ChakraVersionInfo
m_fileVersionLS = chakraVersionInfo->fixedFileInfo.dwFileVersionLS;
m_productVersionMS = chakraVersionInfo->fixedFileInfo.dwProductVersionMS;
m_productVersionLS = chakraVersionInfo->fixedFileInfo.dwProductVersionLS;

#endif
return true;
}

Expand Down
4 changes: 4 additions & 0 deletions vnext/Chakra/ChakraJsiRuntime_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ void ChakraJsiRuntime::setupNativePromiseContinuation() noexcept{
}
}

#if !defined(CHAKRACOREUWP)
// This is very wierd. This should match with the definition of VS_VERSIONINFO as defined in https://docs.microsoft.com/en-us/windows/desktop/menurc/vs-versioninfo
// I can't find a way to include the actual definition of VS_VERSIONINFO
// TODO :: Re-evaluate this strategy.
Expand All @@ -191,12 +192,14 @@ struct FileVersionInfoResource {
VS_FIXEDFILEINFO fixedFileInfo;
uint32_t padding2;
};
#endif

// TODO :: This code is mostly copied from the old ChakraExecutor flow, and not verified for reliability yet.
// TODO :: Re-evaluate this strategy of finding the dll version for versioning the runtime.
/*static*/ void ChakraJsiRuntime::initRuntimeVersion() noexcept {
// This code is win32 only at the moment. We will need to change this
// line if we want to support UWP.
#if !defined(CHAKRACOREUWP)
constexpr wchar_t chakraDllName[] = L"ChakraCore.dll";

auto freeLibraryWrapper = [](void* p) { FreeLibrary((HMODULE)p); };
Expand All @@ -222,6 +225,7 @@ struct FileVersionInfoResource {
s_runtimeVersion = chakraVersionInfo->fixedFileInfo.dwFileVersionMS;
s_runtimeVersion <<= 32;
s_runtimeVersion |= chakraVersionInfo->fixedFileInfo.dwFileVersionLS;
#endif
}

JsErrorCode ChakraJsiRuntime::enableDebugging(JsRuntimeHandle runtime, std::string const& runtimeName, bool breakOnNextLine, uint16_t port,
Expand Down
7 changes: 6 additions & 1 deletion vnext/ReactUWP/ReactUWP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@
REACTWINDOWS_BUILD - building with REACTWINDOWS_API as dll exports
OLD_CPPWINRT is a workaround to make target version to 19H1
-->
<PreprocessorDefinitions>OLD_CPPWINRT;REACTWINDOWS_BUILD;RN_PLATFORM=uwp;USE_EDGEMODE_JSRT;NOMINMAX;FOLLY_NO_CONFIG;RN_EXPORT=;JSI_EXPORT=;WIN32=0;WINRT=1;NOJSC;_HAS_AUTO_PTR_ETC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(CHAKRACOREUWP)'=='true'">CHAKRACORE;CHAKRACOREUWP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(CHAKRACOREUWP)'!='true'">USE_EDGEMODE_JSRT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>OLD_CPPWINRT;REACTWINDOWS_BUILD;RN_PLATFORM=uwp;NOMINMAX;FOLLY_NO_CONFIG;RN_EXPORT=;JSI_EXPORT=;WIN32=0;WINRT=1;NOJSC;_HAS_AUTO_PTR_ETC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ReactNativeWindowsDir);$(ReactNativeWindowsDir)Pch;$(ReactNativeWindowsDir)ReactUWP\GeneratedWinmdHeader;$(ReactNativeWindowsDir)ReactWindowsCore;$(ReactNativeWindowsDir)include\ReactWindowsCore;$(ReactNativeWindowsDir)include\ReactUWP;$(YogaDir);$(ReactNativeDir)\ReactCommon;$(ReactNativeWindowsDir)include;$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)Shared;$(FollyDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(CHAKRACOREUWP)'=='true'">$(ChakraCoreInclude);$(ChakraCoreDebugInclude);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
<ShowIncludes>false</ShowIncludes>
Expand All @@ -90,6 +93,8 @@
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<AdditionalOptions>-minpdbpathlen:256</AdditionalOptions>
<AdditionalDependencies Condition="'$(CHAKRACOREUWP)'=='true'">ChakraCore.Debugger.Protocol.lib;ChakraCore.Debugger.ProtocolHandler.lib;ChakraCore.Debugger.Service.lib;ChakraCore.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="'$(CHAKRACOREUWP)'=='true'">$(ChakraCoreLibDir);$(ChakraCoreDebugLibDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Midl>
Expand Down
2 changes: 1 addition & 1 deletion vnext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
"react": "16.8.3",
"react-native": "^0.59.0 || 0.59.0-microsoft.4 || https://github.com/microsoft/react-native/archive/v0.59.0-microsoft.4.tar.gz"
}
}
}