aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/CMakeLists.txt
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-21 13:58:49 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-23 06:49:09 +0000
commitf0179e7e9c19415f1142b366a248ecfce09ad006 (patch)
tree301a65550c8e5bb977fc4431c97ac7d170b72bb4 /sources/shiboken2/CMakeLists.txt
parentcf4dc77a973fa488594a818381cc9f0941a4f940 (diff)
shiboken: Search for Clang builtin-includes at runtime
Replace the search executed at build time by CMake by a run time search in shiboken since the location at build time typically won't match any more for the deployment case. Task-number: PYSIDE-693 Change-Id: Ib15fbba5d8c3fecf30aaae7195b88a648a7ed0fe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/CMakeLists.txt')
-rw-r--r--sources/shiboken2/CMakeLists.txt40
1 files changed, 0 insertions, 40 deletions
diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt
index 852e14c1a..1af84fca1 100644
--- a/sources/shiboken2/CMakeLists.txt
+++ b/sources/shiboken2/CMakeLists.txt
@@ -113,46 +113,6 @@ endif()
message(STATUS "CLANG: ${CLANG_DIR}, ${CLANG_LIBRARY} detected by ${CLANG_DIR_SOURCE}")
-# Find highest version clang builtin includes folder to pass along to shiboken.
-set(CLANG_BUILTIN_INCLUDES_DIR_PREFIX ${CLANG_DIR}/lib/clang)
-file(GLOB CLANG_BUILTIN_INCLUDES_DIR_CANDIDATES "${CLANG_BUILTIN_INCLUDES_DIR_PREFIX}/*")
-
-# Collect only directories, and not files, and only directories starting with a number.
-set(CLANG_BUILTIN_INCLUDES_DIR_VERSIONS "")
-foreach(candidate ${CLANG_BUILTIN_INCLUDES_DIR_CANDIDATES})
- get_filename_component(candidate_basename ${candidate} NAME)
- if (IS_DIRECTORY ${candidate} AND ${candidate_basename} MATCHES "^[0-9]") # starts with number
- list(APPEND CLANG_BUILTIN_INCLUDES_DIR_VERSIONS ${candidate})
- endif()
-endforeach()
-
-# Sort in alphabetical order the list of version folders.
-list(SORT CLANG_BUILTIN_INCLUDES_DIR_VERSIONS)
-
-# Reverse it so the first element is the highest version.
-list(REVERSE CLANG_BUILTIN_INCLUDES_DIR_VERSIONS)
-
-message(STATUS
- "Found the following CLANG builtins includes directories: ${CLANG_BUILTIN_INCLUDES_DIR_VERSIONS} \
- Considered the following directories: ${CLANG_BUILTIN_INCLUDES_DIR_CANDIDATES}")
-if(CLANG_BUILTIN_INCLUDES_DIR_VERSIONS)
- # Get highest version.
- list(GET CLANG_BUILTIN_INCLUDES_DIR_VERSIONS 0 CLANG_BUILTIN_INCLUDES_DIR_HIGHEST_VERSION)
- if (CLANG_BUILTIN_INCLUDES_DIR_HIGHEST_VERSION)
- # Set the final variable to the full include path to pass along to shiboken.
- set(CLANG_BUILTIN_INCLUDES_DIR "${CLANG_BUILTIN_INCLUDES_DIR_HIGHEST_VERSION}/include")
- endif()
-endif()
-
-message(STATUS "CLANG builtins includes directory chosen: ${CLANG_BUILTIN_INCLUDES_DIR}")
-
-# We don't exit with a hard error here, because it is uncertain whether all clang extra include
-# paths follow the same layout across OSes and distros.
-if (NOT CLANG_BUILTIN_INCLUDES_DIR)
- message(WARNING "No CLANG builtins includes directory found. This may lead to shiboken \
- execution failure.")
-endif()
-
set(CLANG_EXTRA_INCLUDES ${CLANG_DIR}/include)
set(CLANG_EXTRA_LIBRARIES ${CLANG_LIBRARY})