is anyone directly configuring the subdirectories (runtime/, libomptarget/) with CMake? That's currently possible but the usual process (for me) seems to use the root directory that includes runtime/ and libomptarget/ (if OPENMP_ENABLE_LIBOMPTARGET is set).
I'm asking because I'd like to eventually deprecate / remove that support. This would enable us to factor out some common CMake logic, for example to setup tests. If you rely on that process to work or if you think that it's important to have, please speak up!
To show what I have in mind, I have just put up three patches that refactors duplicated code:
https://reviews.llvm.org/D40080: [CMake] Disallow direct configuration
https://reviews.llvm.org/D40081: [CMake] Refactor common settings and flags
https://reviews.llvm.org/D40082: [CMake] Refactor testing infrastructure
(Note that all of these delete more lines than they add while preserving or even adding functionality like a common check-openmp target.)
A fourth patch (https://reviews.llvm.org/D40083) dynamically detects information about the test compiler. This is used to
1) restrict tests for libomptarget to Clang 6.0.0 and newer, and
2) XFAIL some tests for known (older) versions of the compiler - we'll need more of this for OMPT.
Please take a look and kindly tell me what you think.
For Android, we run CMake from the runtimes subdirectory because CMake fails during try_compile for reasons I mentioned in https://reviews.llvm.org/D40080. After adding an empty ‘project()’ right after the version specification, I can successfully build openmp for Android by running CMake from the top-level .
JFYI: I've just committed the first three refactoring patches. As a result, some CMake configuration variables have changed (generic OPENMP_TEST_C_COMPILER, for example).
I included the feedback I got (thanks!) but should there be any issues, please tell me so that I can have a look.