patch-build_CMakeLists_txt 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. $OpenBSD: patch-build_CMakeLists_txt,v 1.5 2015/05/15 08:23:20 bentley Exp $
  2. --- build/CMakeLists.txt.orig Wed Apr 8 15:20:21 2015
  3. +++ build/CMakeLists.txt Fri May 15 02:21:10 2015
  4. @@ -33,48 +33,48 @@ if(DEBUG)
  5. "-Wno-unused-const-variable")
  6. endif()
  7. join("${_arg_str}" CMAKE_C_FLAGS)
  8. -else(DEBUG)
  9. - set(_arg_str "${CMAKE_C_FLAGS} -ansi -O2"
  10. - "-Wuninitialized"
  11. - "-Wstack-protector -fstack-protector")
  12. - if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
  13. - set(_arg_str "${_arg_str}"
  14. - "-Wno-dangling-else"
  15. - # avoid the "argument unused" error in clang
  16. - "-Qunused-arguments")
  17. - endif()
  18. - join("${_arg_str}" CMAKE_C_FLAGS)
  19. +#else(DEBUG)
  20. +# set(_arg_str "${CMAKE_C_FLAGS} -ansi -O2"
  21. +# "-Wuninitialized"
  22. +# "-Wstack-protector -fstack-protector")
  23. +# if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
  24. +# set(_arg_str "${_arg_str}"
  25. +# "-Wno-dangling-else"
  26. +# # avoid the "argument unused" error in clang
  27. +# "-Qunused-arguments")
  28. +# endif()
  29. +# join("${_arg_str}" CMAKE_C_FLAGS)
  30. endif(DEBUG)
  31. # commands to generate the public headers
  32. set(extract_protos sed -n 's/^ \\* PUBLIC: \\\(.*\\\)/\\1/p')
  33. set(extract_version sed -n
  34. 's/^.*version \\\([^\)]*\)\\\).*/\#define VI_VERSION \\\"\\1\\\"/p')
  35. -add_custom_command(OUTPUT ../cl/extern.h
  36. - COMMAND ${extract_protos} ../cl/*.c > $@
  37. - DEPENDS ../cl/*.c)
  38. -add_custom_command(OUTPUT ../common/extern.h
  39. - COMMAND ${extract_protos} ../common/*.c > $@
  40. - DEPENDS ../common/*.c)
  41. -add_custom_command(OUTPUT ../ex/extern.h
  42. - COMMAND ${extract_protos} ../ex/*.c > $@
  43. - DEPENDS ../ex/*.c)
  44. -add_custom_command(OUTPUT ../vi/extern.h
  45. - COMMAND ${extract_protos} ../vi/*.c > $@
  46. - DEPENDS ../vi/*.c)
  47. -add_custom_command(OUTPUT ../common/options_def.h
  48. - COMMAND awk -f ../common/options.awk ../common/options.c > $@
  49. - DEPENDS ../common/options.c)
  50. -add_custom_command(OUTPUT ../ex/ex_def.h
  51. - COMMAND awk -f ../ex/ex.awk ../ex/ex_cmd.c > $@
  52. - DEPENDS ../ex/ex_cmd.c)
  53. -add_custom_command(OUTPUT ../ex/version.h
  54. - COMMAND ${extract_version} ../README > $@
  55. - DEPENDS ../README)
  56. +add_custom_command(OUTPUT cl_extern.h
  57. + COMMAND ${extract_protos} *.c > cl_extern.h
  58. + WORKING_DIRECTORY ../cl/)
  59. +add_custom_command(OUTPUT common_extern.h
  60. + COMMAND ${extract_protos} *.c > common_extern.h
  61. + WORKING_DIRECTORY ../common/)
  62. +add_custom_command(OUTPUT ex_extern.h
  63. + COMMAND ${extract_protos} *.c > ex_extern.h
  64. + WORKING_DIRECTORY ../ex/)
  65. +add_custom_command(OUTPUT vi_extern.h
  66. + COMMAND ${extract_protos} *.c > vi_extern.h
  67. + WORKING_DIRECTORY ../vi/)
  68. +add_custom_command(OUTPUT options_def.h
  69. + COMMAND awk -f options.awk options.c > options_def.h
  70. + WORKING_DIRECTORY ../common/)
  71. +add_custom_command(OUTPUT ex_def.h
  72. + COMMAND awk -f ex.awk ex_cmd.c > ex_def.h
  73. + WORKING_DIRECTORY ../ex/)
  74. +add_custom_command(OUTPUT version.h
  75. + COMMAND ${extract_version} ../README > version.h
  76. + WORKING_DIRECTORY ../ex/)
  77. set(MAIN_PROTOS
  78. - ../cl/extern.h ../common/extern.h ../ex/extern.h ../vi/extern.h
  79. - ../common/options_def.h ../ex/ex_def.h ../ex/version.h)
  80. + cl_extern.h common_extern.h ex_extern.h vi_extern.h
  81. + options_def.h ex_def.h version.h)
  82. FILE(GLOB MAIN_SRCS ../cl/*.c ../common/*.c ../ex/*.c ../vi/*.c)
  83. FILE(GLOB REGEX_SRCS ../regex/reg*.c)
  84. @@ -157,6 +157,7 @@ configure_file(${CMAKE_SOURCE_DIR}/recover.in
  85. ${CMAKE_SOURCE_DIR}/recover @ONLY)
  86. add_executable(nvi ${MAIN_SRCS} ${MAIN_PROTOS})
  87. +add_dependencies(nvi headers)
  88. target_link_libraries(nvi ${CURSES_LIBRARY} ${UTIL_LIBRARY} ${RESOLV_LIBRARY})
  89. if(USE_WIDECHAR)
  90. target_link_libraries(nvi regex)