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

Reid Kleckner rnk at google.com
Thu Jun 4 16:10:26 PDT 2015


Seems like a nice win. :)


================
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>
----------------
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.

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

http://reviews.llvm.org/D10250

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






More information about the llvm-commits mailing list