diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-16 13:06:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-17 11:06:18 +0000 |
commit | 4b2b1fc12137450d34e8324c0dbe2af1e90b9e6a (patch) | |
tree | 9e397602b5f584032cdc29354c0fcf485766cce2 /tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in | |
parent | 29e4b97bad6511ebd6aa009a47594395957c0e8e (diff) |
Add support for compiling ES modules ahead of time
This is also pretty straight-forward by adding .mjs as supported
extension in the qmake and cmake support.
This also tweaks qv4engine.cpp to share the same module compilation
function across all code paths.
Change-Id: Ia0e23c78a794f2330ecf8f991ee6ea948f4ac89d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in')
-rw-r--r-- | tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in index e4963c3a33..a5c531fb0d 100644 --- a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in +++ b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake.in @@ -4,6 +4,7 @@ function(QTQUICK_COMPILER_DETERMINE_OUTPUT_FILENAME outvariable filename) file(RELATIVE_PATH relpath ${CMAKE_CURRENT_SOURCE_DIR} ${filename}) string(REPLACE \".qml\" \"_qml\" relpath ${relpath}) string(REPLACE \".js\" \"_js\" relpath ${relpath}) + string(REPLACE \".mjs\" \"_mjs\" relpath ${relpath}) string(REPLACE \"/\" \"_\" relpath ${relpath}) set(${outvariable} ${CMAKE_CURRENT_BINARY_DIR}/${relpath}.cpp PARENT_SCOPE) endfunction() @@ -63,7 +64,7 @@ but not all the files it references. string(REGEX REPLACE \"[\r\n]+\" \";\" rcc_contents ${rcc_contents}) foreach(it ${rcc_contents}) get_filename_component(extension ${it} EXT) - if(extension STREQUAL \".qml\" OR extension STREQUAL \".js\" OR extension STREQUAL \".ui.qml\") + if(extension STREQUAL \".qml\" OR extension STREQUAL \".js\" OR extension STREQUAL \".ui.qml\" OR extension STREQUAL \".mjs\") qtquick_compiler_determine_output_filename(output_file ${it}) add_custom_command(OUTPUT ${output_file} COMMAND ${compiler_path} ARGS --resource=${input_resource} ${it} -o ${output_file} DEPENDS ${it}) list(APPEND compiler_output ${output_file}) |