[PATCH] D95633: [test-suite] SPEC2017 CPU CactuBSSN floating point tests.
Michael Kruse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 1 18:06:56 PST 2021
Meinersbur added inline comments.
================
Comment at: External/SPEC/CFP2017rate/507.cactuBSSN_r/CMakeLists.txt:13-48
+# Preprocessing and compiler flags depend on programming language type.
+# Create variables for each programming language based on file extension.
+file(GLOB_RECURSE FORTRAN_SRC_FILES ${SRC_DIR}/*.f90)
+file(GLOB_RECURSE C_SRC_FILES ${SRC_DIR}/*.c)
+file(GLOB_RECURSE CPP_SRC_FILES ${SRC_DIR}/*.cc)
+
+# Important to APPEND instead of using CMake's set_source_files_properties
----------------
I would like to suggest a different approach:
```
add_definitions($<$<COMPILE_LANGUAGE:Fortran>:FCODE>)
add_definitions($<$<COMPILE_LANGUAGE:C>:CCODE>)
add_definitions($<$<COMPILE_LANGUAGE:CXX>:CCODE CCTK_DISABLE_RESTRICT=1>)
```
```
set_property(TARGET ${PROG} PROPERTY C_STANDARD 11)
```
or
```
set(CMAKE_C_STANDARD 11)
```
(the last one sets the default for all upcoming targets; however, it is also a global variable but should only be changed within this add_subdirectory scope -- I think). At least the `-std=c99` flag is something the cmake should determine.
Repository:
rT test-suite
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95633/new/
https://reviews.llvm.org/D95633
More information about the llvm-commits
mailing list