[PATCH] D12174: [CMake] Fix building unit tests on Darwin

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 10:49:00 PDT 2015


beanz added a comment.

filcab,

I've just committed r245582 to adapt to this feedback. Let me know if there are other concerns.

Thanks,
-Chris


================
Comment at: cmake/config-ix.cmake:245
@@ +244,3 @@
+      # This is only called in constructing cflags for tests, so we assume OS X.
+      set(${out_var} -arch ${arch} PARENT_SCOPE)
+    endif()
----------------
filcab wrote:
> Should we add the `DARWIN_osx_CFLAGS` here too, for now? That would minimize the number of places where you have to add Apple-specific conditions.
> Eventually we might want to also run the tests for iOS, but for now, if you're on `APPLE`, then you know you're compiling for OS X. Might as well just add all the flags now.
For building tests `DARWIN_osx_CFLAGS` isn't needed, so I was trying to avoid more platform-specific hacking. Not really sure what this is going to look like yet once we fix it.

================
Comment at: lib/asan/tests/CMakeLists.txt:120
@@ +119,3 @@
+  if(APPLE)
+    set(TARGET_CFLAGS ${DARWIN_osx_CFLAGS} -arch ${arch})
+  endif()
----------------
filcab wrote:
> Didn't you already add `-arch ${arch}` in `get_target_flags_for_arch`?
I think I can actually remove this whole block. I just missed it.

================
Comment at: test/asan/CMakeLists.txt:45
@@ -39,3 +44,3 @@
     set(ASAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS})
-  else()
+  elseif(NOT APPLE)
     get_target_flags_for_arch(${arch} ASAN_TEST_TARGET_CFLAGS)
----------------
filcab wrote:
> Why the `NOT APPLE`? Shouldn't you do the same for `APPLE` too?
Yep, this is just another part of the patches I missed cleaning up. Will fix.


Repository:
  rL LLVM

http://reviews.llvm.org/D12174





More information about the llvm-commits mailing list