gitout

A static git page generator
git clone https://git.bracken.jp/gitout.git
Log | Files | Refs | Submodules | README | LICENSE

BUILD.gn (2003B)


      1 # TODO(cbracken): remove personal include, lib dirs.
      2 config("gitout_config") {
      3   include_dirs = [ "//" ] + system_include_dirs
      4   lib_dirs = [] + system_lib_dirs
      5   defines = [
      6     "_XOPEN_SOURCE=700",
      7     "_DEFAULT_SOURCE",
      8     "_BSD_SOURCE",
      9   ]
     10   libs = [ "git2" ]
     11   public_configs = [
     12     "//build:compiler_std",
     13     "//build:compiler_warnings",
     14     "//build:strict_prototypes",
     15   ]
     16   if (is_debug) {
     17     public_configs += [
     18       "//build:debug",
     19       "//build:no_optimize",
     20       "//build:symbols",
     21     ]
     22   } else {
     23     public_configs += [
     24       "//build:release",
     25       "//build:optimize_size",
     26       "//build:lto",
     27     ]
     28   }
     29 }
     30 
     31 group("default") {
     32   testonly = true
     33   deps = [
     34     ":gitout",
     35     ":gitout_index",
     36     ":gitout_tests",
     37   ]
     38 }
     39 executable("gitout") {
     40   sources = [ "gitout_main.c" ]
     41   configs += [ ":gitout_config" ]
     42   deps = [
     43     ":format",
     44     ":gitout_srcs",
     45     ":utils",
     46   ]
     47 }
     48 
     49 executable("gitout_index") {
     50   sources = [ "gitout_index_main.c" ]
     51   configs += [ ":gitout_config" ]
     52   deps = [ ":gitout_index_srcs" ]
     53 }
     54 
     55 executable("gitout_tests") {
     56   testonly = true
     57 
     58   sources = [ "utils_test.cc" ]
     59   deps = [
     60     ":gitout_srcs",
     61     "//third_party/googletest:gtest",
     62     "//third_party/googletest:gtest_main",
     63   ]
     64 }
     65 
     66 source_set("format") {
     67   sources = [
     68     "format.c",
     69     "format.h",
     70   ]
     71   configs += [ ":gitout_config" ]
     72 }
     73 
     74 source_set("gitout_index_srcs") {
     75   sources = [
     76     "gitout_index.c",
     77     "gitout_index.h",
     78   ]
     79   configs += [ ":gitout_config" ]
     80   deps = [
     81     ":security",
     82     "//git",
     83     "//writer:index_writer",
     84   ]
     85 }
     86 
     87 source_set("gitout_srcs") {
     88   sources = [
     89     "gitout.c",
     90     "gitout.h",
     91   ]
     92   configs += [ ":gitout_config" ]
     93   deps = [
     94     ":security",
     95     "//git",
     96     "//writer:repo_writer",
     97   ]
     98 }
     99 
    100 source_set("security") {
    101   sources = [
    102     "security.c",
    103     "security.h",
    104   ]
    105   configs += [ ":gitout_config" ]
    106 }
    107 
    108 source_set("utils") {
    109   sources = [
    110     "utils.c",
    111     "utils.h",
    112   ]
    113   configs += [ ":gitout_config" ]
    114   deps = [ "//third_party/openbsd" ]
    115 }