Skip to content

Commit

Permalink
src/lib: separate directory for source code of cslib.a
Browse files Browse the repository at this point in the history
Closes: #93
  • Loading branch information
kdudka committed Nov 9, 2022
1 parent 7e50c47 commit 5de9670
Show file tree
Hide file tree
Showing 61 changed files with 53 additions and 33 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SANITIZERS ?= OFF
CMAKE_BUILD_TYPE ?= RelWithDebInfo

.PHONY: all check clean sanitizers distclean distcheck distcheck-sanitizers \
fast install version.cc src/version.cc
fast install version.cc src/lib/version.cc

all: version.cc
mkdir -p csdiff_build
Expand All @@ -47,7 +47,7 @@ sanitizers:
$(MAKE) -s all SANITIZERS=ON

distclean:
if test -e .git; then rm -f src/version.cc; fi
if test -e .git; then rm -f src/lib/version.cc; fi
rm -rf csdiff_build

distcheck: distclean
Expand All @@ -59,9 +59,9 @@ distcheck-sanitizers:
install: all
$(MAKE) -C csdiff_build install

version.cc: src/version.cc
version.cc: src/lib/version.cc

src/version.cc:
src/lib/version.cc:
@if test -e .git; then \
cmd='git describe --always | sed -e "s/^csdiff-//" -e "s/-.*-/.$$(git log --pretty="%cd" --date=iso -1 | tr -d ":-" | tr " " . | cut -d. -f 1,2)./"'; \
else \
Expand Down
31 changes: 2 additions & 29 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,8 @@ endif()
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)

# cslib.a
add_library(cs STATIC
abstract-filter.cc
color.cc
csdiff-core.cc
csv-parser.cc
cwe-mapper.cc
cwe-name-lookup.cc
deflookup.cc
instream.cc
msg-filter.cc
parser.cc
parser-common.cc
parser-cov.cc
parser-gcc.cc
parser-json.cc
parser-json-cov.cc
parser-json-gcc.cc
parser-json-sarif.cc
parser-json-shchk.cc
parser-json-simple.cc
parser-xml.cc
parser-xml-valgrind.cc
shared-string.cc
version.cc
writer.cc
writer-cov.cc
writer-html.cc
writer-json.cc
)
add_subdirectory(lib)
include_directories(lib)

# link cslib.a and boost libraries
link_libraries(cs
Expand Down
File renamed without changes.
47 changes: 47 additions & 0 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (C) 2011 - 2022 Red Hat, Inc.
#
# This file is part of csdiff.
#
# csdiff is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# csdiff is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with csdiff. If not, see <http://www.gnu.org/licenses/>.

# cslib.a
add_library(cs STATIC
abstract-filter.cc
color.cc
csdiff-core.cc
csv-parser.cc
cwe-mapper.cc
cwe-name-lookup.cc
deflookup.cc
instream.cc
msg-filter.cc
parser.cc
parser-common.cc
parser-cov.cc
parser-gcc.cc
parser-json.cc
parser-json-cov.cc
parser-json-gcc.cc
parser-json-sarif.cc
parser-json-shchk.cc
parser-json-simple.cc
parser-xml.cc
parser-xml-valgrind.cc
shared-string.cc
version.cc
writer.cc
writer-cov.cc
writer-html.cc
writer-json.cc
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5de9670

Please sign in to comment.