Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. $ cmake .
  2. -- The C compiler identification is GNU
  3. -- Checking whether C compiler has -isysroot
  4. -- Checking whether C compiler has -isysroot - yes
  5. -- Check for working C compiler: /usr/bin/gcc
  6. -- Check for working C compiler: /usr/bin/gcc -- works
  7. -- Detecting C compiler ABI info
  8. -- Detecting C compiler ABI info - done
  9. -- Found BISON: /usr/bin/bison
  10. -- Found FLEX: /usr/bin/flex
  11. -- Looking for _assert_true in cmockery
  12. -- Looking for _assert_true in cmockery - found
  13. -- Configuring done
  14. -- Generating done
  15. -- Build files have been written to: /Users/sebastian/projects/development/pkgparse
  16. $ make
  17. [ 20%] [BISON][pkgbuild_parser] Building parser with bison 2.3
  18. Scanning dependencies of target pkgparse
  19. [ 40%] Building C object CMakeFiles/pkgparse.dir/pkgbuild.o
  20. [ 60%] Building C object CMakeFiles/pkgparse.dir/symbol.o
  21. [ 80%] Building C object CMakeFiles/pkgparse.dir/utility.o
  22. [100%] Building C object CMakeFiles/pkgparse.dir/pkgbuild_parse.o
  23. Linking C shared library libpkgparse.dylib
  24. Undefined symbols:
  25. "_yyerror", referenced from:
  26. _yyparse in pkgbuild_parse.o
  27. _yyparse in pkgbuild_parse.o
  28. "_yylex", referenced from:
  29. _yyparse in pkgbuild_parse.o
  30. "_yyin", referenced from:
  31. _yyin$non_lazy_ptr in pkgbuild_parse.o
  32. ld: symbol(s) not found
  33. collect2: ld returned 1 exit status
  34. make[2]: *** [libpkgparse.dylib] Error 1
  35. make[1]: *** [CMakeFiles/pkgparse.dir/all] Error 2
  36. make: *** [all] Error 2
  37. $ cat CMakeLists.txt
  38. project(pkgparse C)
  39.  
  40. find_package(BISON)
  41. find_package(FLEX)
  42.  
  43. BISON_TARGET(pkgbuild_parser pkgbuild_parse.y ${CMAKE_CURRENT_BINARY_DIR}/pkgbuild_parse.c)
  44. FLEX_TARGET(pkgbuild_scanner pkgbuild_scanner.l ${CMAKE_CURRENT_BIANRY_DIR}/pkgbuild_scanner.c)
  45. ADD_FLEX_BISON_DEPENDENCY(pkgbuild_scanner pkgbuild_parser)
  46.  
  47. set(pkgparse_SRCS
  48. pkgbuild.c
  49. symbol.c
  50. utility.c
  51. ${BISON_pkgbuild_parser_OUTPUTS}
  52. ${FLEX_pkgbuild_parser_OUTPUTS}
  53. )
  54.  
  55. #include_directories(${CMAKE_CURRENT_BINARY_DIR})
  56.  
  57. add_library(pkgparse SHARED ${pkgparse_SRCS})
  58.  
  59. include(CheckLibraryExists)
  60. check_library_exists(cmockery _assert_true "" HAVE_CMOCKERY)
  61.  
  62. # Unit tests
  63. if(HAVE_CMOCKERY)
  64. add_custom_target(test COMMAND ${CMAKE_TEST_COMMAND})
  65. add_executable(test_runner EXCLUDE_FROM_ALL test_runner.c pkgbuild_test.c symbol_test.c utility_test.c)
  66. add_test(test_runner test_runner)
  67. add_dependencies(test test_runner)
  68. find_library(cmockery_LIBRARY NAMES cmockery)
  69. set(cmockery_PROCESS_LIBS cmockery_LIBRARY cmockery_LIBRARIES)
  70. target_link_libraries(test_runner pkgparse cmockery)
  71. endif(HAVE_CMOCKERY)
Add Comment
Please, Sign In to add comment