[PATCH] [CMake] Cleanup add_compiler_rt_object_library to be platform-agnostic

Chris Bieneman beanz at apple.com
Fri Jun 5 13:12:47 PDT 2015


I'll send updated patches shortly.


================
Comment at: cmake/Modules/AddCompilerRT.cmake:6-8
@@ -5,4 +5,5 @@
 
-# Tries to add "object library" target for a given architecture
-# with name "<name>.<arch>" if architecture can be targeted.
-# add_compiler_rt_object_library(<name> <arch>
+# Tries to add "object library" target for a given os and/or architecture
+# with name "<name>.<arch>" for non-Darwin platforms if architecture can be
+# targeted, and "<name>.<os>" for Darwin platforms.
+# add_compiler_rt_object_library(<name>
----------------
rnk wrote:
> I think this needs more updating, it's no longer adding a single object library, it actually creates an object library for each supported OS or architecture. `add_compiler_rt_object_libraries` might be a better name too.
Will do.

================
Comment at: cmake/Modules/AddCompilerRT.cmake:17
@@ +16,3 @@
+  parse_arguments(LIB "OS;ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN})
+  set(libnames)
+  if(APPLE)
----------------
rnk wrote:
> Can you make this a function instead of a macro? Then you don't leak all these variables into the parent scope.
Will do.

================
Comment at: lib/lsan/CMakeLists.txt:22
@@ +21,3 @@
+add_compiler_rt_object_library(RTLSanCommon
+    OS ${SANITIZER_COMMON_SUPPORTED_DARWIN_OS}
+    ARCH ${LSAN_COMMON_SUPPORTED_ARCH}
----------------
samsonov wrote:
> It's weird that we now use `SANITIZER_COMMON_SUPPORTED_DARWIN_OS` on non-Darwin platforms.
This is weird, but I see it as a temporary weirdness. I'm hoping this will all fold away. If you have a preference on how to make it less weird I'm open to suggestions.

My thought, was to eventually just change that to SANITIZER_COMMON_SUPPORTED_OS, and to set it appropriately for whatever OS you are targeting.

http://reviews.llvm.org/D10250

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list