summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-28 16:04:45 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-28 16:05:17 (GMT)
commit7706b6a71406b535ffe2f707647126eac4a8c767 (patch)
tree46e09b93fa4a482a9df9f60c71a55c98e5d728ad /Tests/RunCMake
parentee5edfbda22262a67f630bd83d5494c2ba0d7f44 (diff)
parent64304fe72b2956937b3e0916284aec1efa4dca78 (diff)
downloadCMake-7706b6a71406b535ffe2f707647126eac4a8c767.zip
CMake-7706b6a71406b535ffe2f707647126eac4a8c767.tar.gz
CMake-7706b6a71406b535ffe2f707647126eac4a8c767.tar.bz2
Merge topic 'xcode-top-level-only-with-object-library'
64304fe72b Xcode: Fix post build script for 'top level project only' opt Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4284
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeGenerateTopLevelProjectOnlyWithObjectLibrary.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject/subproject_with_object_lib/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/XcodeProject/subproject_with_object_lib/dummy.cpp5
4 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 6ecf3f2..f1dda54 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -8,6 +8,16 @@ run_cmake(XcodeAttributeLocation)
run_cmake(XcodeAttributeGenex)
run_cmake(XcodeAttributeGenexError)
run_cmake(XcodeGenerateTopLevelProjectOnly)
+
+function(XcodeGenerateTopLevelProjectOnlyWithObjectLibrary)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeGenerateTopLevelProjectOnlyWithObjectLibrary-build)
+ run_cmake(XcodeGenerateTopLevelProjectOnlyWithObjectLibrary)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(XcodeGenerateTopLevelProjectOnlyWithObjectLibrary-build ${CMAKE_COMMAND} --build . --target shared_lib)
+endfunction()
+
+XcodeGenerateTopLevelProjectOnlyWithObjectLibrary()
+
run_cmake(XcodeObjectNeedsEscape)
run_cmake(XcodeObjectNeedsQuote)
run_cmake(XcodeOptimizationFlags)
diff --git a/Tests/RunCMake/XcodeProject/XcodeGenerateTopLevelProjectOnlyWithObjectLibrary.cmake b/Tests/RunCMake/XcodeProject/XcodeGenerateTopLevelProjectOnlyWithObjectLibrary.cmake
new file mode 100644
index 0000000..67e4a00
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeGenerateTopLevelProjectOnlyWithObjectLibrary.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
+project(XcodeGenerateTopLevelProjectOnly NONE)
+add_subdirectory(subproject_with_object_lib)
diff --git a/Tests/RunCMake/XcodeProject/subproject_with_object_lib/CMakeLists.txt b/Tests/RunCMake/XcodeProject/subproject_with_object_lib/CMakeLists.txt
new file mode 100644
index 0000000..ab400f4
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/subproject_with_object_lib/CMakeLists.txt
@@ -0,0 +1,7 @@
+project(subproject_with_object_lib)
+
+add_library(object_lib_dependency OBJECT dummy.cpp)
+
+add_library(shared_lib SHARED dummy.cpp)
+target_sources(shared_lib PRIVATE $<TARGET_OBJECTS:object_lib_dependency>)
+set_target_properties(shared_lib PROPERTIES MACOSX_RPATH ON)
diff --git a/Tests/RunCMake/XcodeProject/subproject_with_object_lib/dummy.cpp b/Tests/RunCMake/XcodeProject/subproject_with_object_lib/dummy.cpp
new file mode 100644
index 0000000..bb4218a
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/subproject_with_object_lib/dummy.cpp
@@ -0,0 +1,5 @@
+namespace {
+void dummy()
+{
+}
+}