Skip to content

Commit 25625fc

Browse files
committed
Reuse LIBOMP_FORTRAN_MODULES
1 parent 7133be1 commit 25625fc

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

openmp/runtime/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ set(LIBOMP_MIC_ARCH knc CACHE STRING
109109
if("${LIBOMP_ARCH}" STREQUAL "mic")
110110
libomp_check_variable(LIBOMP_MIC_ARCH knf knc)
111111
endif()
112-
set(LIBOMP_FORTRAN_MODULES FALSE CACHE BOOL
112+
set(LIBOMP_FORTRAN_MODULES "${RUNTIMES_FLANG_MODULES_ENABLED}" CACHE BOOL
113113
"Create Fortran module files? (requires fortran compiler)")
114114

115115
# - Support for universal fat binary builds on Mac
@@ -147,8 +147,6 @@ else()
147147
set(LIBOMP_LIBFLAGS "" CACHE STRING
148148
"Appended user specified linked libs flags. (e.g., -lm)")
149149
endif()
150-
set(LIBOMP_FFLAGS "" CACHE STRING
151-
"Appended user specified Fortran compiler flags. These are only used if LIBOMP_FORTRAN_MODULES==TRUE.")
152150

153151
# Should the libomp library and generated headers be copied into the original source exports/ directory
154152
# Turning this to FALSE aids parallel builds to not interfere with each other.
@@ -272,10 +270,6 @@ set(LIBOMP_TOOLS_DIR ${LIBOMP_BASE_DIR}/tools)
272270
set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include)
273271
set(LIBOMP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
274272

275-
# Enabling Fortran if it is needed
276-
if(${LIBOMP_FORTRAN_MODULES})
277-
enable_language(Fortran)
278-
endif()
279273
# Enable MASM Compiler if it is needed (Windows only)
280274
if(WIN32)
281275
enable_language(ASM_MASM)

openmp/runtime/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ endif()
449449
# Build the modules files if a Fortran compiler is available.
450450
# Only LLVM_ENABLE_RUNTIMES=openmp is supported, LLVM_ENABLE_PROJECTS=openmp
451451
# has been deprecated.
452-
if(LLVM_RUNTIMES_BUILD AND RUNTIMES_FLANG_MODULES_ENABLED)
452+
if(LIBOMP_FORTRAN_MODULES)
453453
add_library(libomp-mod OBJECT
454454
omp_lib.F90
455455
)

0 commit comments

Comments
 (0)