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:
parent
61be345115
commit
54bf5858cd
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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})
|
||||||
|
|
Loading…
Reference in New Issue