Commit Graph

29 Commits

Author SHA1 Message Date
Alessandro Portale
76bcd85f21 WebAssembly: Avoid soft assert on toolchain auto detection
Windows only: When toolchains get restored on startup,
WebAssemblyToolChain would try to add MinGW to an environment. That
env is used for querying the compiler version. In order to find MinGW,
the MinGW toolchain is queried from ToolChainManager. But since the
ToolChainManager is not yet loaded at this moment, we get a QTC_CHEK
assert from ToolChainManager::toolChain.

This change prevents querying the ToolChainManager before it is loaded.
The compiler version can successfully be determined without MinGW in
path.

Whether we really need to query compiler versions that early is another
question outside the scope of this change.

Change-Id: I46edbb80edc58d7465e90e99f7f8381708f704a1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-23 10:12:50 +00:00
hjk
aa25fdcc69 QtSupport: Rename qtkitinformation.{h,cpp} -> qtkitaspect.{h,cpp}
Change-Id: I12229e5e98b468101d32edd35be74bbda0921d89
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 08:59:52 +00:00
hjk
9567f82b75 WebAssembly: Use the most recent settings access pattern
Includes delaying construction until its first actual use.

Change-Id: Ide0f7a12250c2597f45993d6ef0fb604c974a763
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-07-14 08:00:59 +00:00
Alessandro Portale
5acecd4ef9 WebAssembly: Base Settings handling on Core::PagedSettings
Change-Id: If28afd8046367eb1b8b12e54d2dae4235dbc821f
Reviewed-by: hjk <hjk@qt.io>
2023-05-19 09:55:30 +00:00
Alessandro Portale
caad8074de WebAssembly: Prevent null pointer access
The detector.device can be nullptr

Amends: cacc4aeede

Change-Id: I5b9b6aa722c8e6e8a96d05cdf2f1b214735db858
Reviewed-by: hjk <hjk@qt.io>
2023-05-17 15:37:16 +00:00
hjk
cacc4aeede ProjectExplorer: Run toolchain autodetection on startup
... explicitly only for the Desktop device. This was implicitly done in
some cases by assuming 'no device' == 'desktop'. Make that explicit now.

Change-Id: I2ce86702a9b5b795fb4832301a11a8c8b40e77ea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-17 16:08:42 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Alessandro Portale
6c676636ba WebAssembly: Cleanup FilePath-related includes
Change-Id: If8308b0396ccb0e837fbbb7fcf15f49f7febcc55
Reviewed-by: hjk <hjk@qt.io>
2022-12-01 16:44:45 +00:00
Alessandro Portale
78ef2e2b52 WebAssembly: Convert to using Tr::tr
Change-Id: I7fb420363884236ebd7eeb589a29a475f8911915
Reviewed-by: hjk <hjk@qt.io>
2022-10-04 09:31:38 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
aa98a479cf WebAssembly: Avoid a use of IDevice::mapToGlobalPath()
Change-Id: I79a66caad9a344d1a79d7cf22073a39352f58282
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-10 15:20:31 +00:00
Eike Ziller
b6f679d777 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/webassembly/webassemblytoolchain.cpp

Change-Id: Ia75c783e3ecab1f97de2b5c73a0979c49da82009
2022-03-18 16:07:51 +01:00
hjk
a23c4ce014 Docker: Fix searching compilers in custom directories
Previously, detection (mostly) only used path.

Change-Id: If382205c2ff39cabfe21953e877e152dc952a84c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-03-18 08:21:51 +00:00
hjk
9b7f580a14 WebAssembly: Move auto-detection into stand-alone function
Change-Id: I641946e62998371e6e45b6c6d75e069b8729eaa6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-03 10:16:06 +00:00
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
hjk
5cfe69b049 ProjectExplorer: Use a struct for toolchain autodetection parameters
Also, make some functions const and use an alias for QList<ToolChain *>.

Change-Id: I6a1cbcb79bfaa9d252c4b69e00aa93e5d0dabe2f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-18 11:25:34 +00:00
hjk
652b9844e6 Utils: FilePathify Environment::{ap,pre}pendOrSetPath etc
Change-Id: Idfa5ec247337570936b0236cab9d3a5669792ca0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-10 07:26:31 +00:00
hjk
a78665ede7 Utils: Rename FilePath::searchOnDevice to searchInDirectories
Makes it a bit clearer that there's no magic path use or similar
beyond this point.

Change-Id: I86c06850d16bf777db05ad23b540d8096926c059
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-12 08:29:09 +00:00
hjk
d06c670504 Utils: Introduce a FilePath::withNewPath() convenience method
It's effectively the mirrored version of onDevice() with an
equally odd name which is a bit more straightforward to use
in some cases.

Change-Id: I0cfedeb58871a857c93144e2a0d734bad1bcd887
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 11:13:14 +00:00
hjk
cc1375baa1 Wasm: Only detect toolchains from the emsdk installation device
Change-Id: I910365c6e02e714adf1a233b42df86110cf65a0a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-07-14 15:01:40 +00:00
Christian Kandeler
264fa85f50 Fix a number of compiler warnings
Change-Id: I3e71bffb2099d896742a6fca77febe20e2076464
Reviewed-by: hjk <hjk@qt.io>
2021-07-12 15:24:59 +00:00
hjk
b998ad621b Wasm: Some steps towards making it work on docker
To start using the docker bits the emsdk location has to
be specified manually in the path selector as
docker://<id-of-image>/<path/to/emsdk>

Change-Id: I70c6e7a334762953c3931105b7f697c608523159
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-07-08 10:28:56 +00:00
hjk
509f40825a ProjectExplorer: Pass device to ToolChain::autodetect
Currently unused, will be useful to detect toolchains in docker
containers.

Change-Id: I0fd7643969ab02c05839332a436147ffb242635d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-28 07:59:45 +00:00
Alessandro Portale
b057ea1ab8 WebAssembly: Revamp Emscripten SDK registration and toolchain handling
Qt Creator's ability to register Emscripten toolchains depended on an
SDK being activated "globally", and on the presence of the ~/.emscripten
file. Qt Creator would parse that file in order to determine the
location of the compiler and the necessary environment variables that
have to be set.

As of recently, the Emscripten SDK does neither activate gobally
anymore, nor is the ~/.emscripten generated. This change here addresses
the new situation in a couple of ways:

- Instead of trying to silently detect everything, add a UI
(IOptionsPageWidget) that lets the user select the Emscripten SDK root.
- Instead of parsing the ~/.emscripten file, parse the output of the
emsdk_env tool to determine the toolchain environment
(ToolChain::addToEnvironment). The parsing is cached. A test for the
parsing is included.
- Instead of registering the underlying clang as compiler, register the
emcc/em++ wrapper scripts, which are (also as of recently) compatible
with Qt Creator's way of determining gcc's predefined macros and built-
in header paths.

One Emscripten SDK is registered globally in Qt Creator. When changing
that, the previous Emscripten toolchains are removed, the new ones are
registered and the kit are "fixed" to use those.

On startup, an InfoBar entry is shown if Qt for Webassembly kits exist
and no Emscripten toolchains are present. That's the case for first-time
use after installing Qt for Webassembly via Qt SDK installer. The
InfoBar entry opens up the IOptionsPageWidget.

Qt 5.15.0 for WebAssembly and Emscripten SDK 1.39.0 are the minimum
supported versions. The new UI will show warnings accordingly.

Task-number: QTCREATORBUG-24811
Fixes: QTCREATORBUG-24822
Fixes: QTCREATORBUG-24814
Fixes: QTCREATORBUG-23741
Fixes: QTCREATORBUG-23561
Fixes: QTCREATORBUG-23160
Fixes: QTCREATORBUG-23126
Change-Id: I017c61586b17e815bb20a90e3f305a6bf705da36
Reviewed-by: hjk <hjk@qt.io>
2020-11-16 07:39:20 +00:00
Alessandro Portale
a001944321 WebAssembly: Fix the missing auto-detected "C" toolchain
By not setting the toolchain language twice.

Change-Id: Id7058662047f451dcc524151aa5ff7cec854b9d3
Reviewed-by: hjk <hjk@qt.io>
2020-09-23 11:11:16 +00:00
hjk
a84e626b67 ProjectExplorer: De-QObject-ify ToolChainFactory
As collateral damage, use a capital C in  KeilToolchain*.

Change-Id: If9d64de2108366546683144975d975d9d1727712
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-27 13:58:24 +00:00
Alessandro Portale
f6d2315824 WebAssembly: Add registered MinGW path to toolchain environment
The build system of Qt for WebAssembly on Windows requires MinGW in the
path. If a MinGW toolchain is registeded (e.g. via Sdk installer),
append it to the path.

Change-Id: I5c33cb5c4df636be99f815e307806efc07e18a11
Reviewed-by: hjk <hjk@qt.io>
2019-10-21 08:32:20 +00:00
hjk
71e9e3832a WebAssembly: Remove ToolChain::fromMap hack
GccToolChain::fromMap does not filter anymore.

Change-Id: I0e76703ef1074b4d50999a72b1f598856627de74
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-08-01 16:53:01 +00:00
Alessandro Portale
b89ad81293 WebAssembly: Initial commit
This change adds WebAssembly support in the shape of a plugin.

- Auto-detection of the emsdk toolchain
- Handling of "asmjs-unknown-emscripten" Abi
- Binary detection of WebAssembly libraries
- Auto-creation of a "WebAssembly runtime" device (with icon)
- Runconfiguration that launches the application via the "emrun"
  tool which spawns a local web server and runs the application on
  the chosen web browser.

Limitations:
- So far only tested on Windows/MinGW and Linux
- Not yet tested with Qt WebAssembly installation form the installer
  Only tested with self-built Qt and manually added kit
- The attempt to launch an application via emrun, while a previous
  application is still running, will fail. The reason is that the
  web servers spawned by emrun listen to the same default port but
  serve only the content of one application.
  Possible solutions: We could either spawn the different web servers
  with different ports, or we could use one single web server instance
  which serves the whole default project location (home directory).

Task-number: QTCREATORBUG-21068
Task-number: QTCREATORBUG-22249
Change-Id: I1a16fbe52382d45c37e9bc624a943a6ca475fa09
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-07-25 13:17:51 +00:00