Skip to content

Commit

Permalink
kokkos: add support for replacing -isystem on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
tom91136 committed Sep 1, 2021
1 parent 295c0fe commit 71a2ed5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions kokkos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <headers...>` with `-I <headers...>`.

Compilers can be specified via the usual CMake options, for example:

Expand Down

0 comments on commit 71a2ed5

Please sign in to comment.