fix inconsistency when build both shared/static lib
This commit is contained in:
parent
5be07bdc5e
commit
c829c73d4e
@ -19,10 +19,8 @@ if(BUILD_SHARED_LIBS)
|
||||
else()
|
||||
add_definitions(-DJSON_DLL)
|
||||
endif()
|
||||
target_link_libraries(jsontestrunner_exe jsoncpp_lib)
|
||||
else()
|
||||
target_link_libraries(jsontestrunner_exe jsoncpp_static)
|
||||
endif()
|
||||
target_link_libraries(jsontestrunner_exe jsoncpp_lib)
|
||||
|
||||
set_target_properties(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe)
|
||||
|
||||
|
@ -151,7 +151,11 @@ if(BUILD_SHARED_LIBS)
|
||||
endif()
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(STATIC_LIB ${PROJECT_NAME}_static)
|
||||
else()
|
||||
set(STATIC_LIB ${PROJECT_NAME}_lib)
|
||||
endif()
|
||||
add_library(${STATIC_LIB} STATIC ${PUBLIC_HEADERS} ${JSONCPP_SOURCES})
|
||||
|
||||
# avoid name clashes on windows as the shared import lib is alse named jsoncpp.lib
|
||||
@ -160,7 +164,7 @@ if(BUILD_STATIC_LIBS)
|
||||
endif()
|
||||
|
||||
set_target_properties(${STATIC_LIB} PROPERTIES
|
||||
OUTPUT_NAME jsoncpp${STATIC_SUFFIX}
|
||||
OUTPUT_NAME jsoncpp
|
||||
VERSION ${PROJECT_VERSION}
|
||||
)
|
||||
|
||||
|
@ -15,10 +15,8 @@ if(BUILD_SHARED_LIBS)
|
||||
else()
|
||||
add_definitions( -DJSON_DLL )
|
||||
endif()
|
||||
target_link_libraries(jsoncpp_test jsoncpp_lib)
|
||||
else()
|
||||
target_link_libraries(jsoncpp_test jsoncpp_static)
|
||||
endif()
|
||||
target_link_libraries(jsoncpp_test jsoncpp_lib)
|
||||
|
||||
# another way to solve issue #90
|
||||
#set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store)
|
||||
|
Loading…
Reference in New Issue
Block a user