diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2019-06-19 11:48:40 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2019-06-19 12:29:39 +0300 |
commit | 902e8e75a19eb7582e8caa4e337833ecf1ffe853 (patch) | |
tree | 382334b12984b5cf366bca28c5e857af6994a942 /CMakeLists.txt | |
parent | 5a45684fb675468d0059f4a6dac7634bcf7816f2 (diff) | |
download | bdwgc-902e8e75a19eb7582e8caa4e337833ecf1ffe853.tar.gz |
Build libcord by CMake script
Issue #281 (bdwgc).
* CMakeLists.txt [build_cord] (CORD_SRC): Set variable.
* CMakeLists.txt [build_cord] (cord): Specify add_library and
target_link_libraries; remove TODO.
* CMakeLists.txt [install_headers && build_cord] (cord/cord.h,
cord/cord_pos.h, cord/ec.h): Specify install.
* CMakeLists.txt [build_tests && build_cord] (cordtest, de): Do not
compile cord/cordbscs.c, cord/cordprnt.c, cord/cordxtra.c; add cord to
target_link_libraries specification.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 86424dfe..c0df95f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,7 +261,11 @@ endif() add_library(gc ${SRC}) -# TODO if build_cord then add_library(cord ...) +if (build_cord) + set(CORD_SRC cord/cordbscs.c cord/cordprnt.c cord/cordxtra.c) + add_library(cord ${CORD_SRC}) + target_link_libraries(cord PRIVATE gc) +endif() if (install_headers) install(FILES include/gc.h @@ -283,25 +287,28 @@ if (install_headers) include/gc_cpp.h DESTINATION include/gc) install(FILES include/extra/gc_cpp.h DESTINATION include) - endif(enable_cplusplus) + endif() if (enable_disclaim) install(FILES include/gc_disclaim.h DESTINATION include/gc) - endif(enable_disclaim) - # TODO if build_cord then install cord.h, cord_pos.h, ec.h -endif() + endif() + if (build_cord) + install(FILES include/cord.h + include/cord_pos.h + include/ec.h + DESTINATION include/gc) + endif() +endif(install_headers) if (build_tests) if (build_cord) - add_executable(cordtest cord/cordbscs.c cord/cordprnt.c cord/cordxtra.c - cord/tests/cordtest.c) - target_link_libraries(cordtest PRIVATE gc) + add_executable(cordtest cord/tests/cordtest.c) + target_link_libraries(cordtest PRIVATE cord gc) add_test(NAME cordtest COMMAND cordtest) if (WIN32) - add_executable(de cord/cordbscs.c cord/cordxtra.c - cord/tests/de.c cord/tests/de_win.c) + add_executable(de cord/tests/de.c cord/tests/de_win.c) set_target_properties(de PROPERTIES WIN32_EXECUTABLE TRUE) - target_link_libraries(de PRIVATE gc gdi32) + target_link_libraries(de PRIVATE cord gc gdi32) endif() endif(build_cord) |