diff options
author | Ben Ashbaugh <ben.ashbaugh@intel.com> | 2023-09-12 16:51:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-12 16:51:21 -0700 |
commit | 489ba7af868740b82a78c294ba222b6c649d008e (patch) | |
tree | e0232fa76a1d85bea4ebca3546d40b864abdd5b5 | |
parent | dd1b3407d6cc068ca4f9ed36d6f5b20a7e2b922c (diff) | |
download | OpenCL-Headers-489ba7af868740b82a78c294ba222b6c649d008e.tar.gz |
require C99 for header tests (#208)
* require C99 for header tests
* also require C++11 for header tests
* do not overwrite settings if set by user
Co-authored-by: Nagy-Egri Máté Ferenc <beiktatas+github@outlook.hu>
* fix copy-paste error
---------
Co-authored-by: Nagy-Egri Máté Ferenc <beiktatas+github@outlook.hu>
-rw-r--r-- | tests/CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a2a205a..24f0433 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,17 @@ +if(NOT DEFINED CMAKE_C_STANDARD) + set(CMAKE_C_STANDARD 99) +endif() +if(NOT DEFINED CMAKE_C_STANDARD_REQUIRED) + set(CMAKE_C_STANDARD_REQUIRED ON) +endif() +if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() +if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + + # Add a test for a given source file for each version of OpenCL function(add_header_test NAME SOURCE) # Some headers include system files which require anonymous structs |