mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-31 17:50:26 +08:00
Add fenceposting so DLL flags are only introduced wwhen we are compiling DLL-based shared libraries.
This commit is contained in:
parent
b9adb697ac
commit
e92404f11f
@ -57,12 +57,16 @@ ENDIF()
|
||||
IF(ENABLE_TESTS)
|
||||
|
||||
add_library(ut_util STATIC ut_util.c ut_test.c ut_includes.h ut_test.h ${XGETOPTSRC})
|
||||
target_compile_definitions(ut_util PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
|
||||
IF(ENABLE_DLL)
|
||||
target_compile_definitions(ut_util PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
|
||||
ENDIF(ENABLE_DLL)
|
||||
target_include_directories(ut_util PUBLIC ../libnczarr ../plugins ${CMAKE_CURRENT_LIST_DIR})
|
||||
target_link_libraries(ut_util PUBLIC netcdf ${ALL_TLL_LIBS})
|
||||
|
||||
add_library(test_utils STATIC test_utils.c test_utils.h ${XGETOPTSRC})
|
||||
target_compile_definitions(test_utils PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
|
||||
IF(ENABLE_DLL)
|
||||
target_compile_definitions(test_utils PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
|
||||
ENDIF(ENABLE_DLL)
|
||||
target_include_directories(test_utils PUBLIC ../libnczarr ../plugins ${CMAKE_CURRENT_LIST_DIR})
|
||||
target_link_libraries(test_utils PUBLIC netcdf ${ALL_TLL_LIBS})
|
||||
|
||||
@ -74,13 +78,17 @@ IF(ENABLE_TESTS)
|
||||
|
||||
macro(build_bin_test_with_util_lib F UTIL_LIB)
|
||||
build_bin_test(${F})
|
||||
target_compile_definitions(${F} PUBLIC -DDLL_NETCDF)
|
||||
IF(ENABLE_DLL)
|
||||
target_compile_definitions(${F} PUBLIC -DDLL_NETCDF)
|
||||
ENDIF(ENABLE_DLL)
|
||||
target_link_libraries(${F} ${UTIL_LIB} ${ALL_TLL_LIBS})
|
||||
endmacro()
|
||||
|
||||
macro(add_bin_test_with_util_lib PREFIX F UTIL_LIB)
|
||||
add_bin_test(${PREFIX} ${F})
|
||||
target_compile_definitions(${PREFIX}_${F} PUBLIC -DDLL_NETCDF)
|
||||
IF(ENABLE_DLL)
|
||||
target_compile_definitions(${PREFIX}_${F} PUBLIC -DDLL_NETCDF)
|
||||
ENDIF(ENABLE_DLL)
|
||||
target_link_libraries(${PREFIX}_${F} ${UTIL_LIB} ${ALL_TLL_LIBS})
|
||||
|
||||
endmacro()
|
||||
|
Loading…
x
Reference in New Issue
Block a user