[flang-commits] [flang] [flang] cmake fix for FLANG_RUNTIME_F128_MATH_LIB build (PR #93054)

via flang-commits flang-commits at lists.llvm.org
Wed May 22 08:34:57 PDT 2024


https://github.com/dpalermo created https://github.com/llvm/llvm-project/pull/93054

Remove an extra '-D' in the call to add_compile_definitions. The extra -D causes -D-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath to appear in compile options which results in a compilation failure. This occurs only on systems using cmake versions 3.22.1 or 3.24.3. Using cmake 3.28.1 seems to automatically remove the duplicate -D.

Fixes https://github.com/llvm/llvm-project/pull/81971

>From 845fb009bd96ad3b88702b7aa4dbfb47c7ca4164 Mon Sep 17 00:00:00 2001
From: Dan Palermo <dan.palermo at amd.com>
Date: Wed, 22 May 2024 10:23:53 -0500
Subject: [PATCH] [flang] cmake fix for FLANG_RUNTIME_F128_MATH_LIB build

Remove an extra '-D' in the call to add_compile_definitions.
The extra -D causes -D-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath to
appear in compile options which results in a compilation failure.
This occurs only on systems using cmake versions 3.22.1 or 3.24.3.
Using cmake 3.28.1 seems to automatically remove the duplicate -D.

Fixes https://github.com/llvm/llvm-project/pull/81971
---
 flang/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index c8e75024823f2..af34366b36526 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -336,7 +336,7 @@ endif()
 
 if (FLANG_RUNTIME_F128_MATH_LIB)
   add_compile_definitions(
-    -DFLANG_RUNTIME_F128_MATH_LIB="${FLANG_RUNTIME_F128_MATH_LIB}"
+    FLANG_RUNTIME_F128_MATH_LIB="${FLANG_RUNTIME_F128_MATH_LIB}"
     )
 endif()
 



More information about the flang-commits mailing list