summaryrefslogtreecommitdiffstats
path: root/src/tools/qlalr
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-04-27 15:04:57 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-06-02 22:42:15 +0200
commit5a779a4ad350accadc4337d332eedb29ba1cc26b (patch)
tree50263a99b188539a28aaf733a07bb0072eab8fa8 /src/tools/qlalr
parent47c6466d0acc6d8d733b4fdbaf980a60bbfc93ef (diff)
CMake: Make it possible to build tools when cross-compiling
This patch allows tools to be built for the target platform when the QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration time. To avoid naming conflicts, the target tools are suffixed with "_native". The qt_get_tool_target_name() function can be used to get the tool name for both scenarios (cross and non-cross compilation). Extend pro2cmake to refer to the right target name for tools. The relevant write_XXX functions have a new target_ref parameter that will be "${target_name}" for tools and literally the target name for everything else. Fixes: QTBUG-81901 Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/tools/qlalr')
-rw-r--r--src/tools/qlalr/.prev_CMakeLists.txt3
-rw-r--r--src/tools/qlalr/CMakeLists.txt3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/qlalr/.prev_CMakeLists.txt b/src/tools/qlalr/.prev_CMakeLists.txt
index c933cde1b4..00c4abc0cd 100644
--- a/src/tools/qlalr/.prev_CMakeLists.txt
+++ b/src/tools/qlalr/.prev_CMakeLists.txt
@@ -4,7 +4,8 @@
## qlalr Tool:
#####################################################################
-qt_add_tool(qlalr
+qt_get_tool_target_name(target_name qlalr)
+qt_add_tool(${target_name}
TARGET_DESCRIPTION "Qt Look Ahead LR Parser Generator"
SOURCES
compress.cpp compress.h
diff --git a/src/tools/qlalr/CMakeLists.txt b/src/tools/qlalr/CMakeLists.txt
index bf13e6f492..b0137d4918 100644
--- a/src/tools/qlalr/CMakeLists.txt
+++ b/src/tools/qlalr/CMakeLists.txt
@@ -4,7 +4,8 @@
## qlalr Tool:
#####################################################################
-qt_add_tool(qlalr
+qt_get_tool_target_name(target_name qlalr)
+qt_add_tool(${target_name}
TARGET_DESCRIPTION "Qt Look Ahead LR Parser Generator"
TOOLS_TARGET Core # special case
SOURCES