Tests: Resolve TODO comment left in ObjectLibrary test

We now have a generic way to add -fPIC without explicitly modifying
CMAKE_C_FLAGS, so use it.
This commit is contained in:
Brad King 2014-07-02 14:40:59 -04:00
parent 61be345115
commit 54bf5858cd
2 changed files with 2 additions and 8 deletions

View File

@ -1,9 +1,6 @@
project(ObjectLibraryA C) project(ObjectLibraryA C)
# Add -fPIC so objects can be used in shared libraries. # Add -fPIC so objects can be used in shared libraries.
# TODO: Need property for this. set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(CMAKE_SHARED_LIBRARY_C_FLAGS AND NOT WATCOM)
set(CMAKE_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${CMAKE_C_FLAGS}")
endif()
add_definitions(-DA_DEF) add_definitions(-DA_DEF)

View File

@ -5,10 +5,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
endif() endif()
# Add -fPIC so objects can be used in shared libraries. # Add -fPIC so objects can be used in shared libraries.
# TODO: Need property for this. set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(CMAKE_SHARED_LIBRARY_C_FLAGS AND NOT WATCOM)
set(CMAKE_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${CMAKE_C_FLAGS}")
endif()
add_library(B OBJECT b1.c b2.c) add_library(B OBJECT b1.c b2.c)
target_include_directories(B PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(B PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})