Move implementation specific stuff from format.h to format.cc.

This commit is contained in:
Victor Zverovich
2014-08-15 08:40:03 -07:00
parent c7cfa7d4e7
commit fb32161fa4
4 changed files with 25 additions and 24 deletions
+7 -3
View File
@@ -1,17 +1,21 @@
set(TEST_MAIN_SRC test-main.cc gtest-extra.cc gtest-extra.h util.cc)
add_library(test-main ${TEST_MAIN_SRC})
target_link_libraries(test-main gtest format)
target_link_libraries(test-main gtest)
# Adds a test.
# Usage: add_fmt_test(name libs srcs...)
function(add_fmt_test name libs)
add_executable(${name} ${name}.cc ${ARGN})
cmake_parse_arguments(add_fmt_test CUSTOM_LINK "" "" ${ARGN})
add_executable(${name} ${name}.cc ${add_fmt_test_UNPARSED_ARGUMENTS})
target_link_libraries(${name} ${libs})
if (NOT add_fmt_test_CUSTOM_LINK)
target_link_libraries(${name} format)
endif ()
add_test(${name} ${name})
endfunction()
add_fmt_test(gtest-extra-test test-main)
add_fmt_test(format-test test-main)
add_fmt_test(format-test test-main CUSTOM_LINK ../posix.cc ../posix.h)
add_fmt_test(printf-test test-main)
foreach (target format-test printf-test)
if (CMAKE_COMPILER_IS_GNUCXX)