BUG: Fix ExportImport test on VS6

Visual Studio 6 does not support per-target object files, so just use two
separate source file names in this case.
This commit is contained in:
Brad King 2008-08-12 17:27:48 -04:00
parent ec5f5b093f
commit 1712cd0a98
3 changed files with 10 additions and 2 deletions

View File

@ -35,6 +35,12 @@ set_property(TARGET testLib3 PROPERTY SOVERSION 3)
add_library(testLib4 SHARED testLib4.c) add_library(testLib4 SHARED testLib4.c)
set_property(TARGET testLib4 PROPERTY FRAMEWORK 1) set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
# Work-around: Visual Studio 6 does not support per-target object files.
set(VS6)
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
set(VS6 1)
endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
# Test using the target_link_libraries command to set the # Test using the target_link_libraries command to set the
# LINK_INTERFACE_LIBRARIES* properties. We construct two libraries # LINK_INTERFACE_LIBRARIES* properties. We construct two libraries
# providing the same two symbols. In each library one of the symbols # providing the same two symbols. In each library one of the symbols
@ -43,8 +49,8 @@ set_property(TARGET testLib4 PROPERTY FRAMEWORK 1)
# configuration in which it is built. If the proper library is not # configuration in which it is built. If the proper library is not
# used via the link interface the import test will fail to link. # used via the link interface the import test will fail to link.
add_library(testLib4lib STATIC testLib4lib.c) add_library(testLib4lib STATIC testLib4lib.c)
add_library(testLib4libdbg STATIC testLib4libopt.c testLib4libdbg.c) add_library(testLib4libdbg STATIC testLib4libopt.c testLib4libdbg${VS6}.c)
add_library(testLib4libopt STATIC testLib4libdbg.c testLib4libopt.c) add_library(testLib4libopt STATIC testLib4libdbg.c testLib4libopt${VS6}.c)
set_property(TARGET testLib4libdbg PROPERTY COMPILE_DEFINITIONS LIB_DBG) set_property(TARGET testLib4libdbg PROPERTY COMPILE_DEFINITIONS LIB_DBG)
set_property(TARGET testLib4libopt PROPERTY COMPILE_DEFINITIONS LIB_OPT) set_property(TARGET testLib4libopt PROPERTY COMPILE_DEFINITIONS LIB_OPT)
target_link_libraries(testLib4 target_link_libraries(testLib4

View File

@ -0,0 +1 @@
#include "testLib4libdbg.c"

View File

@ -0,0 +1 @@
#include "testLib4libopt.c"