This revision was automatically updated to reflect the committed changes.
Closed by commit rL364035: [unittests] Simplify CMakeLists with object library 
(authored by tkrasnukha, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D63544?vs=205816&id=205971#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63544/new/

https://reviews.llvm.org/D63544

Files:
  lldb/trunk/unittests/tools/lldb-mi/utils/CMakeLists.txt


Index: lldb/trunk/unittests/tools/lldb-mi/utils/CMakeLists.txt
===================================================================
--- lldb/trunk/unittests/tools/lldb-mi/utils/CMakeLists.txt
+++ lldb/trunk/unittests/tools/lldb-mi/utils/CMakeLists.txt
@@ -1,30 +1,13 @@
-# Create object library to avoid unnecessary linking. If CMake version
-# doesn't support it, just create an ordinary library.
-if(NOT (${CMAKE_VERSION} VERSION_LESS "3.5.0"))
-  set (LIBRARY_TYPE "OBJECT")
-endif()
-
-add_library(lldb-mi-utils ${LIBRARY_TYPE}
+add_library(lldb-mi-utils OBJECT
   ${LLDB_SOURCE_DIR}/tools/lldb-mi/MIUtilString.cpp
   )
 
 add_lldb_unittest(LLDBMiUtilTests
+  $<TARGET_OBJECTS:lldb-mi-utils>
   StringTest.cpp
 
   LINK_COMPONENTS
     Support
   )
 
-if((${CMAKE_VERSION} VERSION_LESS "3.5.0") OR
-    NOT (${CMAKE_VERSION} VERSION_LESS "3.12.0"))
-  # Link to either usual (cmake version < 3.5) or
-  # object (cmake version >= 3.12) library with lldm-mi sources.
-  target_link_libraries(LLDBMiUtilTests PRIVATE lldb-mi-utils)
-else()
-  # Object libraries still cannot be on the right-hand side of
-  # `target_link_libraries` but `$<TARGET_OBJECTS:objlib>` expression is
-  # already supported in `target_sources`.
-  target_sources(LLDBMiUtilTests PRIVATE $<TARGET_OBJECTS:lldb-mi-utils>)
-endif()
-
 set_target_properties(lldb-mi-utils PROPERTIES FOLDER "lldb libraries")


Index: lldb/trunk/unittests/tools/lldb-mi/utils/CMakeLists.txt
===================================================================
--- lldb/trunk/unittests/tools/lldb-mi/utils/CMakeLists.txt
+++ lldb/trunk/unittests/tools/lldb-mi/utils/CMakeLists.txt
@@ -1,30 +1,13 @@
-# Create object library to avoid unnecessary linking. If CMake version
-# doesn't support it, just create an ordinary library.
-if(NOT (${CMAKE_VERSION} VERSION_LESS "3.5.0"))
-  set (LIBRARY_TYPE "OBJECT")
-endif()
-
-add_library(lldb-mi-utils ${LIBRARY_TYPE}
+add_library(lldb-mi-utils OBJECT
   ${LLDB_SOURCE_DIR}/tools/lldb-mi/MIUtilString.cpp
   )
 
 add_lldb_unittest(LLDBMiUtilTests
+  $<TARGET_OBJECTS:lldb-mi-utils>
   StringTest.cpp
 
   LINK_COMPONENTS
     Support
   )
 
-if((${CMAKE_VERSION} VERSION_LESS "3.5.0") OR
-    NOT (${CMAKE_VERSION} VERSION_LESS "3.12.0"))
-  # Link to either usual (cmake version < 3.5) or
-  # object (cmake version >= 3.12) library with lldm-mi sources.
-  target_link_libraries(LLDBMiUtilTests PRIVATE lldb-mi-utils)
-else()
-  # Object libraries still cannot be on the right-hand side of
-  # `target_link_libraries` but `$<TARGET_OBJECTS:objlib>` expression is
-  # already supported in `target_sources`.
-  target_sources(LLDBMiUtilTests PRIVATE $<TARGET_OBJECTS:lldb-mi-utils>)
-endif()
-
 set_target_properties(lldb-mi-utils PROPERTIES FOLDER "lldb libraries")
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to