From 71a2ed56b0015b52dd8c716262c288b3b112a03e Mon Sep 17 00:00:00 2001 From: Tom Lin Date: Wed, 1 Sep 2021 17:49:56 +0100 Subject: [PATCH] kokkos: add support for replacing -isystem on demand --- kokkos/CMakeLists.txt | 7 +++++++ kokkos/README.md | 1 + 2 files changed, 8 insertions(+) diff --git a/kokkos/CMakeLists.txt b/kokkos/CMakeLists.txt index 04e5f2d..c3c0f20 100644 --- a/kokkos/CMakeLists.txt +++ b/kokkos/CMakeLists.txt @@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR) project(bude_kokkos) +# XXX CMAKE_INCLUDE_SYSTEM_FLAG_* must be set after entry into this script as the flag gets overwritten at CMake initialisaiton. +# so we can't just pass -DCMAKE_INCLUDE_SYSTEM_FLAG_CXX=... +if(CUSTOM_SYSTEM_INCLUDE_FLAG) + set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "${CUSTOM_SYSTEM_INCLUDE_FLAG}") + set(CMAKE_INCLUDE_SYSTEM_FLAG_C "${CUSTOM_SYSTEM_INCLUDE_FLAG}") +endif() + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/kokkos/README.md b/kokkos/README.md index 7740f7d..04da9ef 100644 --- a/kokkos/README.md +++ b/kokkos/README.md @@ -19,6 +19,7 @@ Flags: * `FORWARD_CXX_EXTRA_FLAGS_TO_KOKKOS` : `ON|OFF`, whether to forward `CXX_EXTRA_FLAGS` when building Kokkos. This is `OFF` by default as Kokkos has a set of tested flags for each compiler. * `Kokkos_ROOT`: `STRING`, path to the local Kokkos installation, this is optional and mutually exclusive with `KOKKOS_IN_TREE`. * `DEFAULT_WGSIZE`: `INGEGER`, sets the [block size](#block-size). Defaults to 64. +* `CUSTOM_SYSTEM_INCLUDE_FLAG`, sets the prefix flag for including system libraries. For example, setting this flag to `-I` replaces all `-isystem ` with `-I `. Compilers can be specified via the usual CMake options, for example: