Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25078] Windows: run cmake flag always defaults to Visual Studio 2015 generator

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2017-08-21T09:15:15.000+0000
Affected Version/sRelease 6.1.2
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelsn/a
ReporterEwan Harris
AssigneeKota Iguchi
Created2017-08-09T13:25:20.000+0000
Updated2017-08-22T09:30:10.000+0000

Description

Description

When using the --run-cmake flag with VS2017 the generator selected will always be Visual Studio 14 2015 this is because the check [here](https://github.com/appcelerator/titanium_mobile_windows/blob/18d58eb3a3b123ac916017661b83635a28e8caec/templates/module/default/template/windows/plugins/hooks/windows.js#L41) needs to be data.windowsInfo.selectedVisualStudio Below is the working code
function selectVisualStudio(data) {
    if (data.windowsInfo && data.windowsInfo.selectedVisualStudio) {
        var version = data.windowsInfo.selectedVisualStudio.version;
        if (version == '12.0') {
            return 'Visual Studio 12 2013';
        } else if (version == '14.0') {
            return 'Visual Studio 14 2015';
        } else if (/^Visual Studio \w+ 2017/.test(version)) {
            return 'Visual Studio 15 2017';
        }
    }
    return 'Visual Studio 14 2015';
}

Steps to reproduce

You need VS2017 to test this 1. Grab https://github.com/appcelerator-archive/ti.paint 2. Overwrite ti.paint/windows/plugins/hooks/windows.js with the hook [here](https://github.com/appcelerator/titanium_mobile_windows/blob/18d58eb3a3b123ac916017661b83635a28e8caec/templates/module/default/template/windows/plugins/hooks/windows.js) 3. Make sure the path at ti.paint/blob/master/windows/CMakeLists.txt#L24, matches your selected 4. Build the module using appc run -p windows --build-only --run-cmake

Actual

Errors out with
[DEBUG] Run CMake on C:\Users\ewan\Documents\git\ti.paint\windows\Windows10.Win32
[WARN]  CMake Error at CMakeLists.txt:20 (project):
  A Windows Store component with CMake requires both the Windows Desktop SDK
  as well as the Windows Store '10.0' SDK.  Please make sure that you have
  both installed
[INFO]  -- Configuring incomplete, errors occurred!
See also "C:/Users/ewan/Documents/git/ti.paint/windows/Windows10.Win32/CMakeFiles/CMakeOutput.log".
Checking ti.paint\windows\Windows10.Win32\CMakeCache.txt shows CMAKE_GENERATOR:INTERNAL is Visual Studio 14 2015

Expected

Should select VS2017 generator and build successfully (note that you might still see a failure due to it attempting to build 8.1)

Comments

  1. Kota Iguchi 2017-08-09

    FYI Hyperloop had similar issue (TIMOB-25077) and here's the fix: https://github.com/appcelerator/hyperloop.next/pull/200/files
  2. Kota Iguchi 2017-08-10

    This issue is addressed in the [PR for TIMOB-24189](https://github.com/appcelerator/titanium_mobile_windows/pull/959/commits/02e554618b29d2a88a44252a4ac5d6ce1a81d475).
  3. Ewan Harris 2017-08-22

    Verified changes in 6.2.0.v20170821203442

JSON Source