aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2023-10-11 18:02:38 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-11-01 20:14:17 +0000
commit2ef46c91cd6dd27dce898638bf0f644dd89e4afe (patch)
tree63d034623564808c590df88413dfce6014a8e4c5
parentf742e21955410b4e3f545a5cdaf6769abfe81922 (diff)
CMake: Allow passing extra generator flags via a CMake variable
When building shiboken or pyside directly using CMake, allow passing extra command line options to the shiboken executable when generating bindings. The variable is called SHIBOKEN_GENERATOR_EXTRA_FLAGS and expects a semicolon list of extra options to pass. This is useful for cross-compilation to specify things like extra compiler flags or include paths that the API extractor should take into account when parsing sources. Task-number: PYSIDE-1958 Change-Id: I4896fc870d85861e7cc5adbb0e5ae7222ab61a40 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 3d8e5382fb8d1239f7390c06dcad3ca8a96e299e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/pyside6/cmake/PySideSetup.cmake12
-rw-r--r--sources/shiboken6/tests/CMakeLists.txt1
2 files changed, 8 insertions, 5 deletions
diff --git a/sources/pyside6/cmake/PySideSetup.cmake b/sources/pyside6/cmake/PySideSetup.cmake
index d6f20bd11..577a3fc7a 100644
--- a/sources/pyside6/cmake/PySideSetup.cmake
+++ b/sources/pyside6/cmake/PySideSetup.cmake
@@ -218,11 +218,13 @@ if(NOT PYTHON_SITE_PACKAGES)
shiboken_internal_set_python_site_packages()
endif()
-set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken
- --enable-parent-ctor-heuristic
- --enable-pyside-extensions
- --enable-return-value-heuristic
- --use-isnull-as-nb-bool)
+set(GENERATOR_EXTRA_FLAGS
+ ${SHIBOKEN_GENERATOR_EXTRA_FLAGS}
+ --generator-set=shiboken
+ --enable-parent-ctor-heuristic
+ --enable-pyside-extensions
+ --enable-return-value-heuristic
+ --use-isnull-as-nb-bool)
use_protected_as_public_hack()
# Build with Address sanitizer enabled if requested. This may break things, so use at your own risk.
diff --git a/sources/shiboken6/tests/CMakeLists.txt b/sources/shiboken6/tests/CMakeLists.txt
index 6707dfe0a..3c82d766e 100644
--- a/sources/shiboken6/tests/CMakeLists.txt
+++ b/sources/shiboken6/tests/CMakeLists.txt
@@ -21,6 +21,7 @@ else()
message(STATUS "Tests will be generated using the protected hack!")
set(GENERATOR_EXTRA_FLAGS )
endif()
+list(APPEND GENERATOR_EXTRA_FLAGS ${SHIBOKEN_GENERATOR_EXTRA_FLAGS})
add_subdirectory(minimalbinding)
if(NOT DEFINED MINIMAL_TESTS)