Skip to content

[lldb/cmake] Remove EXTRA_CXXFLAGS arg #143731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025
Merged

[lldb/cmake] Remove EXTRA_CXXFLAGS arg #143731

merged 1 commit into from
Jun 12, 2025

Conversation

labath
Copy link
Collaborator

@labath labath commented Jun 11, 2025

We have one library using this and three libraries directly calling target_compile_options. Might as well standardize on the latter.

We have one library using this and three libraries directly calling
`target_compile_options`. Might as well standardize on the latter.
@labath labath requested a review from bulbazord June 11, 2025 15:38
@labath labath requested a review from JDevlieghere as a code owner June 11, 2025 15:38
@llvmbot llvmbot added the lldb label Jun 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2025

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

Changes

We have one library using this and three libraries directly calling target_compile_options. Might as well standardize on the latter.


Full diff: https://github.com/llvm/llvm-project/pull/143731.diff

2 Files Affected:

  • (modified) lldb/cmake/modules/AddLLDB.cmake (+1-4)
  • (modified) lldb/source/Plugins/Language/ObjC/CMakeLists.txt (+10-12)
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index 0108fb22e5a03..28bf8d816d89a 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -41,7 +41,7 @@ function(add_lldb_library name)
   cmake_parse_arguments(PARAM
     "MODULE;SHARED;STATIC;OBJECT;PLUGIN;FRAMEWORK;NO_INTERNAL_DEPENDENCIES;NO_PLUGIN_DEPENDENCIES"
     "INSTALL_PREFIX"
-    "EXTRA_CXXFLAGS;LINK_LIBS;CLANG_LIBS"
+    "LINK_LIBS;CLANG_LIBS"
     ${ARGN})
 
   if(PARAM_NO_INTERNAL_DEPENDENCIES)
@@ -130,9 +130,6 @@ function(add_lldb_library name)
     add_dependencies(${name} clang-tablegen-targets)
   endif()
 
-  # Add in any extra C++ compilation flags for this library.
-  target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})
-
   if(PARAM_PLUGIN)
     get_property(parent_dir DIRECTORY PROPERTY PARENT_DIRECTORY)
     if(EXISTS ${parent_dir})
diff --git a/lldb/source/Plugins/Language/ObjC/CMakeLists.txt b/lldb/source/Plugins/Language/ObjC/CMakeLists.txt
index 93c23fd32524b..b9fc5ce754c49 100644
--- a/lldb/source/Plugins/Language/ObjC/CMakeLists.txt
+++ b/lldb/source/Plugins/Language/ObjC/CMakeLists.txt
@@ -1,13 +1,3 @@
-set(EXTRA_CXXFLAGS "")
-
-if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
-  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-gnu-anonymous-struct)
-endif ()
-
-if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
-  set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -Wno-nested-anon-types)
-endif ()
-
 add_lldb_library(lldbPluginObjCLanguage PLUGIN
   ObjCLanguage.cpp
   CF.cpp
@@ -36,6 +26,14 @@ add_lldb_library(lldbPluginObjCLanguage PLUGIN
     lldbPluginTypeSystemClang
   CLANG_LIBS
     clangAST
-
-  EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS}
 )
+
+if (CXX_SUPPORTS_NO_GNU_ANONYMOUS_STRUCT)
+  target_compile_options(lldbPluginObjCLanguage
+    PRIVATE -Wno-gnu-anonymous-struct)
+endif ()
+
+if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES)
+  target_compile_options(lldbPluginObjCLanguage
+    PRIVATE -Wno-nested-anon-types)
+endif ()

Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using what cmake provides, makes sense to me.

@labath labath merged commit 622df89 into llvm:main Jun 12, 2025
9 checks passed
@labath labath deleted the cmake2 branch June 12, 2025 13:27
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
We have one library using this and three libraries directly calling
`target_compile_options`. Might as well standardize on the latter.
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
We have one library using this and three libraries directly calling
`target_compile_options`. Might as well standardize on the latter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants