|
10 | 10 |
|
11 | 11 | include(ExtendPath)
|
12 | 12 |
|
| 13 | +# The generated headers will be placed in clang's resource directory if present. |
| 14 | +if(OPENMP_STANDALONE_BUILD OR NOT LLVM_RUNTIMES_BUILD) |
| 15 | + set(LIBOMP_HEADERS_INTDIR ${CMAKE_CURRENT_BINARY_DIR}) |
| 16 | +else() |
| 17 | + set(LIBOMP_HEADERS_INTDIR ${LLVM_BINARY_DIR}/${LIBOMP_HEADERS_INSTALL_PATH}) |
| 18 | +endif() |
| 19 | + |
13 | 20 | # Configure omp.h, kmp_config.h and omp-tools.h if necessary
|
14 |
| -configure_file(${LIBOMP_INC_DIR}/omp.h.var omp.h @ONLY) |
15 |
| -configure_file(${LIBOMP_INC_DIR}/ompx.h.var ompx.h @ONLY) |
16 |
| -configure_file(kmp_config.h.cmake kmp_config.h @ONLY) |
| 21 | +configure_file(${LIBOMP_INC_DIR}/omp.h.var ${LIBOMP_HEADERS_INTDIR}/omp.h @ONLY) |
| 22 | +configure_file(${LIBOMP_INC_DIR}/ompx.h.var ${LIBOMP_HEADERS_INTDIR}/ompx.h @ONLY) |
| 23 | +configure_file(kmp_config.h.cmake ${LIBOMP_HEADERS_INTDIR}/kmp_config.h @ONLY) |
17 | 24 | if(${LIBOMP_OMPT_SUPPORT})
|
18 |
| - configure_file(${LIBOMP_INC_DIR}/omp-tools.h.var omp-tools.h @ONLY) |
| 25 | + configure_file(${LIBOMP_INC_DIR}/omp-tools.h.var ${LIBOMP_HEADERS_INTDIR}/omp-tools.h @ONLY) |
19 | 26 | endif()
|
20 | 27 |
|
21 | 28 | # Generate message catalog files: kmp_i18n_id.inc and kmp_i18n_default.inc
|
@@ -48,6 +55,7 @@ include_directories(
|
48 | 55 | ${LIBOMP_SRC_DIR}/i18n
|
49 | 56 | ${LIBOMP_INC_DIR}
|
50 | 57 | ${LIBOMP_SRC_DIR}/thirdparty/ittnotify
|
| 58 | + ${LIBOMP_HEADERS_INTDIR} |
51 | 59 | )
|
52 | 60 |
|
53 | 61 | # Building with time profiling support requires LLVM directory includes.
|
@@ -419,15 +427,15 @@ else()
|
419 | 427 | endif()
|
420 | 428 | install(
|
421 | 429 | FILES
|
422 |
| - ${CMAKE_CURRENT_BINARY_DIR}/omp.h |
423 |
| - ${CMAKE_CURRENT_BINARY_DIR}/ompx.h |
| 430 | + ${LIBOMP_HEADERS_INTDIR}/omp.h |
| 431 | + ${LIBOMP_HEADERS_INTDIR}/ompx.h |
424 | 432 | DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}
|
425 | 433 | )
|
426 | 434 | if(${LIBOMP_OMPT_SUPPORT})
|
427 |
| - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}) |
| 435 | + install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}) |
428 | 436 | # install under legacy name ompt.h
|
429 |
| - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h) |
430 |
| - set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) |
| 437 | + install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h) |
| 438 | + set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_HEADERS_INTDIR} PARENT_SCOPE) |
431 | 439 | endif()
|
432 | 440 | if(${BUILD_FORTRAN_MODULES})
|
433 | 441 | set (destination ${LIBOMP_HEADERS_INSTALL_PATH})
|
|
0 commit comments