googlesamples / vulkan-basic-samples

Other
498 stars 111 forks source link

Support setting Android ABI with cmake on Windows #9

Closed qchong closed 7 years ago

qchong commented 7 years ago

In the Vulkan Getting Started guide, this command works for Linux and Mac:

$ cmake -DANDROID=ON -DANDROID_ABI=[armeabi-v7a|arm64-v8a| x86|x86_64|all(default)]

However, running the equivalent command in Windows returns errors: e.g.

c:\dev\github-projects\vulkan-basic-samples\LunarGSamples\API-Samples>"c:\Program Files\CMake\bin\cmake"  -DANDROID=ON -DANDROID_ABI=armeabi-v7a
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
  The CMAKE_C_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the NMake generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error in CMakeLists.txt:
  The CMAKE_CXX_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the NMake generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "C:/dev/github-projects/vulkan-basic-samples/LunarGSamples/API-Samples/CMakeFiles/CMakeOutput.log".
See also "C:/dev/github-projects/vulkan-basic-samples/LunarGSamples/API-Samples/CMakeFiles/CMakeError.log".

Please provide an equivalent way to do this in Windows without requiring users to install VS.

ggfan commented 7 years ago

thank you for the report: it is real and interesting issue, now I realized, in a sense:

Before that, windows platform would not be able to generate Android Studio project files; it is not that bad though -- all Android Project are already inside github repo, no need to re-generate it if default stl-type (gnustl-static) is ok.

ggfan commented 7 years ago

updated docs: done: updated to README.md and wiki page

please check it out. thanks

qchong commented 7 years ago

I've reviewed the README.md (https://github.com/googlesamples/vulkan-basic-samples/blob/master/README.md) and the Wiki page (https://github.com/googlesamples/vulkan-basic-samples/wiki/Updating-project-file).

For README.md:

For the wiki page:

ggfan commented 7 years ago

1) as of today: building shaderc is a MUST 2) On windows, need to follow the upstream windows instruction to set up the machine, then do android specific steps in this repo. in other words, this repo's instruction is Additional steps to the upstream instruction for Windows.

ggfan commented 7 years ago

again, on Windows, steps inside "Windows System Requirements" must be followed before updating project, if you choose to update it.

ggfan commented 7 years ago

closing down this, reopen when necessary. Thanks