chakra-core / ChakraCore

ChakraCore is an open source Javascript engine with a C API.
MIT License
9.1k stars 1.19k forks source link

Unsupported target processor: AMD64 #6760

Closed ScSofts closed 1 year ago

ScSofts commented 2 years ago

I'm working on a project which use ChakraCore as a library with cmake. However, an error occurred.

Platform: Windows + Microsoft Visual Studio 2017 + CMake.

Code:

add_subdirectory(chakra-core)
include_directories(chakra-core/lib/)
include_directories(chakra-core/lib/Jsrt)
include_directories(chakra-core/lib/Runtime)

CommandLine:

F:\Repos\Tode\build>d:\sdk\cmake-3.14.0-win32-x86\bin\cmake .
CMake Error at core/engine/chakra-core/CMakeLists.txt:63 (message):
  Unsupported target processor: AMD64

-- Configuring incomplete, errors occurred!
See also "F:/Repos/Tode/build/CMakeFiles/CMakeOutput.log".
ScSofts commented 2 years ago

When I changed to Linux, the error had disappeared.

ppenzin commented 2 years ago

ChakraCore uses VisualStudio directly on Windows, solution file is Build\Chakra.Core.sln. Also see Building ChakraCore in Readme.

Enabling CMake builds on Windows is something of interest though.

ScSofts commented 2 years ago

ChakraCore uses VisualStudio directly on Windows, solution file is Build\Chakra.Core.sln. Also see Building ChakraCore in Readme.

Enabling CMake builds on Windows is something of interest though.

Thank you. I have found solution in https://github.com/microsoft/Chakra-Samples/blob/master/ChakraCore%20Samples/Hello%20World/CMake/CMakeLists.txt

rhuanjl commented 2 years ago

Currently the CMake setup is intended for Linux and macOS (and it works on those platforms); if you'd like to make it work on windows we would accept a pull request for that.

The visual studio solution file works on windows - the available cmake files are not (currently) tested on windows.