summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-19 14:47:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-04-19 14:47:31 (GMT)
commit44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46 (patch)
treec95b4621b9a71adc962c9c2e3e3140a0fb73e627 /Tests
parent9db9bb27ea3f3dd3db3913c2bc2233f03018d5b0 (diff)
parenteec93bceec5411e4409b5e3ee5dc301fca6fcbfd (diff)
downloadCMake-44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46.zip
CMake-44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46.tar.gz
CMake-44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46.tar.bz2
Merge topic 'objlib-extend'
eec93bce Allow OBJECT libraries to be installed, exported, and imported 93c89bc7 Genex: Allow TARGET_OBJECTS to be used everywhere ac0cf7ff Genex: Reject TARGET_OBJECTS on non-object libraries earlier 8577978c Tests: ExportImport C code should use explicit (void) in prototypes 26cfd039 cmInstallTargetGenerator: Re-order GenerateScriptForConfig logic 25f3f22a cmGlobalGenerator: Add method to check if object file location is known d596c550 cmGeneratorTarget: Add method to get the object file directory 930042f2 cmGeneratorTarget: Factor out a GetTargetObjectNames method ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !712
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt13
-rw-r--r--Tests/ExportImport/Export/sub/testLib8C.c4
-rw-r--r--Tests/ExportImport/Export/testLib8A.c4
-rw-r--r--Tests/ExportImport/Export/testLib8B.c4
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt10
-rw-r--r--Tests/ExportImport/Import/A/imp_testExe1.c24
-rw-r--r--Tests/ExportImport/Import/A/imp_testLib8.c8
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt16
-rw-r--r--Tests/GeneratorExpression/check_object_files.cmake26
-rw-r--r--Tests/GeneratorExpression/objlib1.c4
-rw-r--r--Tests/GeneratorExpression/objlib2.c4
-rw-r--r--Tests/RunCMake/File_Generate/OutputConflict-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt7
-rw-r--r--Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake1
-rw-r--r--Tests/RunCMake/ObjectLibrary/Export-stderr.txt4
-rw-r--r--Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt (renamed from Tests/RunCMake/TargetObjects/BadContext-result.txt)0
-rw-r--r--Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt5
-rw-r--r--Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake2
-rw-r--r--Tests/RunCMake/ObjectLibrary/Import.cmake11
-rw-r--r--Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt (renamed from Tests/RunCMake/ObjectLibrary/Install-result.txt)0
-rw-r--r--Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt (renamed from Tests/RunCMake/ObjectLibrary/Import-stderr.txt)5
-rw-r--r--Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake1
-rw-r--r--Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt (renamed from Tests/RunCMake/ObjectLibrary/Import-result.txt)0
-rw-r--r--Tests/RunCMake/ObjectLibrary/InstallNotSupported-stderr.txt (renamed from Tests/RunCMake/ObjectLibrary/Install-stderr.txt)5
-rw-r--r--Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake2
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/ObjectLibrary/b.c4
-rw-r--r--Tests/RunCMake/TargetObjects/BadContext-stderr.txt27
-rw-r--r--Tests/RunCMake/TargetObjects/NoTarget-result.txt (renamed from Tests/RunCMake/ObjectLibrary/Export-result.txt)0
-rw-r--r--Tests/RunCMake/TargetObjects/NoTarget-stderr.txt24
-rw-r--r--Tests/RunCMake/TargetObjects/NoTarget.cmake (renamed from Tests/RunCMake/TargetObjects/BadContext.cmake)0
-rw-r--r--Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt1
-rw-r--r--Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt8
-rw-r--r--Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake3
-rw-r--r--Tests/RunCMake/TargetObjects/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/TargetObjects/empty.cpp4
36 files changed, 193 insertions, 58 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index f504c7b..eeae3f0 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -79,6 +79,15 @@ set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_DEBUG testLib7D-$<CONFIG>)
set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_RELEASE testLib7R-$<CONFIG>)
set_property(TARGET testLib7 PROPERTY OUTPUT_NAME testLib7-$<CONFIG>)
+# Test exporting OBJECT targets
+add_library(testLib8 OBJECT testLib8A.c testLib8B.c sub/testLib8C.c)
+
+if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
+ set(maybe_testLib8 testLib8)
+else()
+ set(maybe_testLib8 "")
+endif()
+
# Test using the target_link_libraries command to set the
# LINK_INTERFACE_LIBRARIES* properties. We construct two libraries
# providing the same two symbols. In each library one of the symbols
@@ -474,7 +483,7 @@ install(
TARGETS
testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3 testExe4
testExe2lib testLib4lib testLib4libdbg testLib4libopt
- testLib6 testLib7
+ testLib6 testLib7 ${maybe_testLib8}
testLibCycleA testLibCycleB
testLibNoSONAME
cmp0022NEW cmp0022OLD
@@ -483,6 +492,7 @@ install(
RUNTIME DESTINATION $<1:bin>
LIBRARY DESTINATION $<1:lib> NAMELINK_SKIP
ARCHIVE DESTINATION $<1:lib>
+ OBJECTS DESTINATION $<1:lib>
FRAMEWORK DESTINATION Frameworks
BUNDLE DESTINATION Applications
)
@@ -535,6 +545,7 @@ export(TARGETS testExe1 testLib1 testLib2 testLib3
FILE ExportBuildTree.cmake
)
export(TARGETS testExe2 testLib4 testLib5 testLib6 testLib7 testExe3 testExe4 testExe2lib
+ ${maybe_testLib8}
testLib4lib testLib4libdbg testLib4libopt
testLibCycleA testLibCycleB
testLibNoSONAME
diff --git a/Tests/ExportImport/Export/sub/testLib8C.c b/Tests/ExportImport/Export/sub/testLib8C.c
new file mode 100644
index 0000000..a5568c7
--- /dev/null
+++ b/Tests/ExportImport/Export/sub/testLib8C.c
@@ -0,0 +1,4 @@
+int testLib8C(void)
+{
+ return 0;
+}
diff --git a/Tests/ExportImport/Export/testLib8A.c b/Tests/ExportImport/Export/testLib8A.c
new file mode 100644
index 0000000..c64655a
--- /dev/null
+++ b/Tests/ExportImport/Export/testLib8A.c
@@ -0,0 +1,4 @@
+int testLib8A(void)
+{
+ return 0;
+}
diff --git a/Tests/ExportImport/Export/testLib8B.c b/Tests/ExportImport/Export/testLib8B.c
new file mode 100644
index 0000000..1be6c9c
--- /dev/null
+++ b/Tests/ExportImport/Export/testLib8B.c
@@ -0,0 +1,4 @@
+int testLib8B(void)
+{
+ return 0;
+}
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 5ce9628..01960ea 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -228,6 +228,16 @@ target_link_libraries(imp_lib1 exp_testLib2)
add_library(imp_lib1b STATIC imp_lib1.c)
target_link_libraries(imp_lib1b bld_testLib2)
+if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
+ # Create a executable that is using objects imported from the install tree
+ add_executable(imp_testLib8 imp_testLib8.c $<TARGET_OBJECTS:exp_testLib8>)
+
+ if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT XCODE_VERSION VERSION_LESS 5)
+ # Create a executable that is using objects imported from the build tree
+ add_executable(imp_testLib8b imp_testLib8.c $<TARGET_OBJECTS:bld_testLib8>)
+ endif()
+endif()
+
#-----------------------------------------------------------------------------
# Test that handling imported targets, including transitive dependencies,
# works in CheckFunctionExists (...and hopefully all other try_compile() checks
diff --git a/Tests/ExportImport/Import/A/imp_testExe1.c b/Tests/ExportImport/Import/A/imp_testExe1.c
index 83a9bb5..3488439 100644
--- a/Tests/ExportImport/Import/A/imp_testExe1.c
+++ b/Tests/ExportImport/Import/A/imp_testExe1.c
@@ -1,15 +1,15 @@
-extern int generated_by_testExe1();
-extern int generated_by_testExe3();
-extern int generated_by_testExe4();
-extern int testLib2();
-extern int testLib3();
-extern int testLib4();
-extern int testLib4lib();
-extern int testLib5();
-extern int testLib6();
-extern int testLib7();
-extern int testLibCycleA1();
-extern int testLibPerConfigDest();
+extern int generated_by_testExe1(void);
+extern int generated_by_testExe3(void);
+extern int generated_by_testExe4(void);
+extern int testLib2(void);
+extern int testLib3(void);
+extern int testLib4(void);
+extern int testLib4lib(void);
+extern int testLib5(void);
+extern int testLib6(void);
+extern int testLib7(void);
+extern int testLibCycleA1(void);
+extern int testLibPerConfigDest(void);
/* Switch a symbol between debug and optimized builds to make sure the
proper library is found from the testLib4 link interface. */
diff --git a/Tests/ExportImport/Import/A/imp_testLib8.c b/Tests/ExportImport/Import/A/imp_testLib8.c
new file mode 100644
index 0000000..2749b17
--- /dev/null
+++ b/Tests/ExportImport/Import/A/imp_testLib8.c
@@ -0,0 +1,8 @@
+
+int testLib8A(void);
+int testLib8B(void);
+
+int main()
+{
+ return (testLib8A() + testLib8B());
+}
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index adc87cd..8ac3419 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -292,3 +292,19 @@ set(CMP0044_TYPE NEW)
add_subdirectory(CMP0044 ${CMAKE_BINARY_DIR}/CMP0044-NEW)
set(CMP0044_TYPE OLD)
add_subdirectory(CMP0044 ${CMAKE_BINARY_DIR}/CMP0044-OLD)
+
+if(NOT CMAKE_GENERATOR STREQUAL Xcode OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
+ add_library(objlib OBJECT objlib1.c objlib2.c)
+ file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/objlib_files_$<CONFIGURATION>"
+ CONTENT "$<JOIN:$<TARGET_OBJECTS:objlib>,\n>\n"
+ )
+
+ add_custom_target(check_object_files ALL
+ COMMAND ${CMAKE_COMMAND}
+ "-DOBJLIB_LISTFILE=${CMAKE_CURRENT_BINARY_DIR}/objlib_files_$<CONFIGURATION>"
+ -DEXPECTED_NUM_OBJECTFILES=2
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/check_object_files.cmake"
+ DEPENDS objlib
+ )
+endif()
diff --git a/Tests/GeneratorExpression/check_object_files.cmake b/Tests/GeneratorExpression/check_object_files.cmake
new file mode 100644
index 0000000..cfccd29
--- /dev/null
+++ b/Tests/GeneratorExpression/check_object_files.cmake
@@ -0,0 +1,26 @@
+
+if (NOT EXISTS ${OBJLIB_LISTFILE})
+ message(SEND_ERROR "Object listing file \"${OBJLIB_LISTFILE}\" not found!")
+endif()
+
+file(STRINGS ${OBJLIB_LISTFILE} objlib_files ENCODING UTF-8)
+
+list(LENGTH objlib_files num_objectfiles)
+if (NOT EXPECTED_NUM_OBJECTFILES EQUAL num_objectfiles)
+ message(SEND_ERROR "Unexpected number of entries in object list file (${num_objectfiles} instead of ${EXPECTED_NUM_OBJECTFILES})")
+endif()
+
+foreach(objlib_file ${objlib_files})
+ set(file_exists False)
+ if (EXISTS ${objlib_file})
+ set(file_exists True)
+ endif()
+
+ if (NOT file_exists)
+ if(attempts)
+ list(REMOVE_DUPLICATES attempts)
+ set(tried " Tried ${attempts}")
+ endif()
+ message(SEND_ERROR "File \"${objlib_file}\" does not exist!${tried}")
+ endif()
+endforeach()
diff --git a/Tests/GeneratorExpression/objlib1.c b/Tests/GeneratorExpression/objlib1.c
new file mode 100644
index 0000000..98a95a4
--- /dev/null
+++ b/Tests/GeneratorExpression/objlib1.c
@@ -0,0 +1,4 @@
+
+void objlib1()
+{
+}
diff --git a/Tests/GeneratorExpression/objlib2.c b/Tests/GeneratorExpression/objlib2.c
new file mode 100644
index 0000000..b2c1050
--- /dev/null
+++ b/Tests/GeneratorExpression/objlib2.c
@@ -0,0 +1,4 @@
+
+void objlib2()
+{
+}
diff --git a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt
index 0abb7df..a242180 100644
--- a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt
+++ b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt
@@ -1,5 +1,6 @@
CMake Error in CMakeLists.txt:
- Evaluation file to be written multiple times for different configurations
- or languages with different content:
+ Evaluation file to be written multiple times with different content. This
+ is generally caused by the content evaluating the configuration type,
+ language, or location of object files:
.*output.txt
diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt
index d3aa973..b08ef5a 100644
--- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt
+++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt
@@ -1,9 +1,8 @@
-CMake Error at OutputNameMatchesObjects.cmake:2 \(file\):
+CMake Error at OutputNameMatchesObjects.cmake:[0-9]+ \(file\):
Error evaluating generator expression:
\$<TARGET_OBJECTS:foo>
- The evaluation of the TARGET_OBJECTS generator expression is only suitable
- for consumption by CMake. It is not suitable for writing out elsewhere.
+ Objects of target "foo" referenced but is not an OBJECT library.
Call Stack \(most recent call first\):
- CMakeLists.txt:6 \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake
index d807450..daa7c49 100644
--- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake
+++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<BOOL:$<TARGET_OBJECTS:foo>>somefile.cpp"
diff --git a/Tests/RunCMake/ObjectLibrary/Export-stderr.txt b/Tests/RunCMake/ObjectLibrary/Export-stderr.txt
deleted file mode 100644
index bdadca4..0000000
--- a/Tests/RunCMake/ObjectLibrary/Export-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at Export.cmake:2 \(export\):
- export given OBJECT library "A" which may not be exported.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetObjects/BadContext-result.txt b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/TargetObjects/BadContext-result.txt
+++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-result.txt
diff --git a/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt
new file mode 100644
index 0000000..5420159
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at ExportNotSupported.cmake:[0-9]+ \(export\):
+ export given OBJECT library "A" which may not be exported under Xcode with
+ multiple architectures.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake
new file mode 100644
index 0000000..a3f104e
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/ExportNotSupported.cmake
@@ -0,0 +1,2 @@
+add_library(A OBJECT a.c)
+export(TARGETS A FILE AExport.cmake)
diff --git a/Tests/RunCMake/ObjectLibrary/Import.cmake b/Tests/RunCMake/ObjectLibrary/Import.cmake
index 806b44a..42f4468 100644
--- a/Tests/RunCMake/ObjectLibrary/Import.cmake
+++ b/Tests/RunCMake/ObjectLibrary/Import.cmake
@@ -1 +1,12 @@
+
add_library(A OBJECT IMPORTED)
+
+# We don't actually build this example so just configure dummy
+# object files to test. They do not have to exist.
+set_property(TARGET A APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+set_target_properties(A PROPERTIES
+ IMPORTED_OBJECTS_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o"
+ IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o"
+ )
+
+add_library(B $<TARGET_OBJECTS:A> b.c)
diff --git a/Tests/RunCMake/ObjectLibrary/Install-result.txt b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/ObjectLibrary/Install-result.txt
+++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt
diff --git a/Tests/RunCMake/ObjectLibrary/Import-stderr.txt b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt
index 74b496a..0fadac2 100644
--- a/Tests/RunCMake/ObjectLibrary/Import-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt
@@ -1,4 +1,5 @@
-CMake Error at Import.cmake:1 \(add_library\):
- The OBJECT library type may not be used for IMPORTED libraries.
+CMake Error at ImportNotSupported.cmake:[0-9]+ \(add_library\):
+ The OBJECT library type may not be used for IMPORTED libraries under Xcode
+ with multiple architectures.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake
new file mode 100644
index 0000000..806b44a
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake
@@ -0,0 +1 @@
+add_library(A OBJECT IMPORTED)
diff --git a/Tests/RunCMake/ObjectLibrary/Import-result.txt b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/ObjectLibrary/Import-result.txt
+++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-result.txt
diff --git a/Tests/RunCMake/ObjectLibrary/Install-stderr.txt b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-stderr.txt
index d2f9f4a..35a0e4f 100644
--- a/Tests/RunCMake/ObjectLibrary/Install-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported-stderr.txt
@@ -1,4 +1,5 @@
-CMake Error at Install.cmake:2 \(install\):
- install TARGETS given OBJECT library "A" which may not be installed.
+CMake Error at InstallNotSupported.cmake:[0-9]+ \(install\):
+ install TARGETS given OBJECT library "A" which may not be installed under
+ Xcode with multiple architectures.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake
new file mode 100644
index 0000000..c1d214b
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/InstallNotSupported.cmake
@@ -0,0 +1,2 @@
+add_library(A OBJECT a.c)
+install(TARGETS A DESTINATION lib)
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index e932693..fe708ce 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -5,9 +5,15 @@ run_cmake(BadSourceExpression2)
run_cmake(BadSourceExpression3)
run_cmake(BadObjSource1)
run_cmake(BadObjSource2)
-run_cmake(Export)
-run_cmake(Import)
-run_cmake(Install)
+if(RunCMake_GENERATOR STREQUAL "Xcode" AND "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]")
+ run_cmake(ExportNotSupported)
+ run_cmake(ImportNotSupported)
+ run_cmake(InstallNotSupported)
+else()
+ run_cmake(Export)
+ run_cmake(Import)
+ run_cmake(Install)
+endif()
run_cmake(LinkObjLHS)
run_cmake(LinkObjRHS1)
run_cmake(LinkObjRHS2)
diff --git a/Tests/RunCMake/ObjectLibrary/b.c b/Tests/RunCMake/ObjectLibrary/b.c
new file mode 100644
index 0000000..6751907
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/b.c
@@ -0,0 +1,4 @@
+int b(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt b/Tests/RunCMake/TargetObjects/BadContext-stderr.txt
deleted file mode 100644
index b78189e..0000000
--- a/Tests/RunCMake/TargetObjects/BadContext-stderr.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-(CMake Error at BadContext.cmake:4 \(file\):
- Error evaluating generator expression:
-
- \$<TARGET_OBJECTS:NoTarget>
-
- The evaluation of the TARGET_OBJECTS generator expression is only suitable
- for consumption by CMake. It is not suitable for writing out elsewhere.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-*)+
-(CMake Error at BadContext.cmake:5 \(file\):
- Error evaluating generator expression:
-
- \$<TARGET_OBJECTS:NoTarget>
-
- The evaluation of the TARGET_OBJECTS generator expression is only suitable
- for consumption by CMake. It is not suitable for writing out elsewhere.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-*)+
-CMake Error:
- Error evaluating generator expression:
-
- \$<TARGET_OBJECTS:NoTarget>
-
- The evaluation of the TARGET_OBJECTS generator expression is only suitable
- for consumption by CMake. It is not suitable for writing out elsewhere.
diff --git a/Tests/RunCMake/ObjectLibrary/Export-result.txt b/Tests/RunCMake/TargetObjects/NoTarget-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/ObjectLibrary/Export-result.txt
+++ b/Tests/RunCMake/TargetObjects/NoTarget-result.txt
diff --git a/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt
new file mode 100644
index 0000000..eadccaf
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt
@@ -0,0 +1,24 @@
+(CMake Error at NoTarget.cmake:4 \(file\):
+ Error evaluating generator expression:
+
+ \$<TARGET_OBJECTS:NoTarget>
+
+ Objects of target "NoTarget" referenced but no such target exists.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+*)+
+(CMake Error at NoTarget.cmake:5 \(file\):
+ Error evaluating generator expression:
+
+ \$<TARGET_OBJECTS:NoTarget>
+
+ Objects of target "NoTarget" referenced but no such target exists.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+*)+
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_OBJECTS:NoTarget>
+
+ Objects of target "NoTarget" referenced but no such target exists.
diff --git a/Tests/RunCMake/TargetObjects/BadContext.cmake b/Tests/RunCMake/TargetObjects/NoTarget.cmake
index 5d7e33e..5d7e33e 100644
--- a/Tests/RunCMake/TargetObjects/BadContext.cmake
+++ b/Tests/RunCMake/TargetObjects/NoTarget.cmake
diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt
new file mode 100644
index 0000000..a66794c
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at NotObjlibTarget.cmake:3 \(file\):
+ Error evaluating generator expression:
+
+ \$<TARGET_OBJECTS:StaticLib>
+
+ Objects of target "StaticLib" referenced but is not an OBJECT library.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake
new file mode 100644
index 0000000..8e5fdd0
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake
@@ -0,0 +1,3 @@
+add_library(StaticLib empty.cpp)
+
+file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:StaticLib>)
diff --git a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake
index 85c76e2..30b9fee 100644
--- a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
-run_cmake(BadContext)
+run_cmake(NoTarget)
+run_cmake(NotObjlibTarget)
diff --git a/Tests/RunCMake/TargetObjects/empty.cpp b/Tests/RunCMake/TargetObjects/empty.cpp
new file mode 100644
index 0000000..4086dcc
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/empty.cpp
@@ -0,0 +1,4 @@
+int empty()
+{
+ return 0;
+}