From ef5d5e84c58d381b3f78a8b24d031ccdfb38f5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 14 Nov 2020 21:31:50 +0100 Subject: [PATCH] Fixed #8936 (Add PicoJSON Copyright notice) --- .travis.yml | 2 +- Makefile | 9 +++------ externals/externals.pri | 4 +++- externals/{ => picojson}/picojson.h | 0 externals/z3-LICENSE | 10 ++++++++++ lib/CMakeLists.txt | 1 + lib/cppcheck.vcxproj | 16 ++++++++-------- tools/dmake.cpp | 11 ++++++----- win_installer/cppcheck.wxs | 4 ++++ 9 files changed, 36 insertions(+), 21 deletions(-) rename externals/{ => picojson}/picojson.h (100%) create mode 100644 externals/z3-LICENSE diff --git a/.travis.yml b/.travis.yml index 1b6aa8604..9316c47fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -194,7 +194,7 @@ script: - make -s check -j2 CPPFLAGS=-DTEST_MATHLIB_VALUE - touch lib/mathlib.cpp test/testmathlib.cpp # syntax checking of cppcheck source code with -DNONNEG - - ls lib/*.cpp | xargs -n 1 -P 2 g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/simplecpp -Iexternals/tinyxml -DNONNEG + - ls lib/*.cpp | xargs -n 1 -P 2 g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml -DNONNEG # compile cppcheck, default build - echo $CXXFLAGS - make -s check -j2 diff --git a/Makefile b/Makefile index ca87d358d..747fa7ac5 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ ifndef PREFIX endif ifndef INCLUDE_FOR_LIB - INCLUDE_FOR_LIB=-Ilib -isystem externals -isystem externals/simplecpp -isystem externals/tinyxml + INCLUDE_FOR_LIB=-Ilib -isystem externals -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml endif ifndef INCLUDE_FOR_CLI @@ -494,7 +494,7 @@ $(libcppdir)/checkvaarg.o: lib/checkvaarg.cpp lib/astutils.h lib/check.h lib/che $(libcppdir)/clangimport.o: lib/clangimport.cpp lib/clangimport.h lib/config.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/clangimport.o $(libcppdir)/clangimport.cpp -$(libcppdir)/cppcheck.o: lib/cppcheck.cpp externals/picojson.h externals/simplecpp/simplecpp.h externals/tinyxml/tinyxml2.h lib/analyzerinfo.h lib/check.h lib/checkunusedfunctions.h lib/clangimport.h lib/config.h lib/cppcheck.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/exprengine.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/version.h +$(libcppdir)/cppcheck.o: lib/cppcheck.cpp externals/picojson/picojson.h externals/simplecpp/simplecpp.h externals/tinyxml/tinyxml2.h lib/analyzerinfo.h lib/check.h lib/checkunusedfunctions.h lib/clangimport.h lib/config.h lib/cppcheck.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/exprengine.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h lib/version.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/cppcheck.o $(libcppdir)/cppcheck.cpp $(libcppdir)/ctu.o: lib/ctu.cpp externals/tinyxml/tinyxml2.h lib/astutils.h lib/check.h lib/config.h lib/ctu.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h @@ -512,7 +512,7 @@ $(libcppdir)/exprengine.o: lib/exprengine.cpp lib/astutils.h lib/bughuntingcheck $(libcppdir)/forwardanalyzer.o: lib/forwardanalyzer.cpp lib/analyzer.h lib/astutils.h lib/config.h lib/errortypes.h lib/forwardanalyzer.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/utils.h lib/valueflow.h lib/valueptr.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/forwardanalyzer.o $(libcppdir)/forwardanalyzer.cpp -$(libcppdir)/importproject.o: lib/importproject.cpp externals/picojson.h externals/tinyxml/tinyxml2.h lib/config.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h +$(libcppdir)/importproject.o: lib/importproject.cpp externals/picojson/picojson.h externals/tinyxml/tinyxml2.h lib/config.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/importproject.o $(libcppdir)/importproject.cpp $(libcppdir)/library.o: lib/library.cpp externals/tinyxml/tinyxml2.h lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h @@ -785,9 +785,6 @@ externals/simplecpp/simplecpp.o: externals/simplecpp/simplecpp.cpp externals/sim externals/tinyxml/tinyxml2.o: externals/tinyxml/tinyxml2.cpp externals/tinyxml/tinyxml2.h $(CXX) $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) -w $(UNDEF_STRICT_ANSI) -c -o externals/tinyxml/tinyxml2.o externals/tinyxml/tinyxml2.cpp -tools/clang-ast.o: tools/clang-ast.cpp - $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o tools/clang-ast.o tools/clang-ast.cpp - tools/dmake.o: tools/dmake.cpp cli/filelister.h lib/config.h lib/pathmatch.h $(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o tools/dmake.o tools/dmake.cpp diff --git a/externals/externals.pri b/externals/externals.pri index 7f0be8de3..f0e8c2803 100644 --- a/externals/externals.pri +++ b/externals/externals.pri @@ -1,8 +1,10 @@ INCLUDEPATH += $${PWD} \ + $${PWD}/picojson \ $${PWD}/simplecpp \ $${PWD}/tinyxml -HEADERS += $${PWD}/simplecpp/simplecpp.h \ +HEADERS += $${PWD}/picojson/picojson.h \ + $${PWD}/simplecpp/simplecpp.h \ $${PWD}/tinyxml/tinyxml2.h SOURCES += $${PWD}/simplecpp/simplecpp.cpp \ diff --git a/externals/picojson.h b/externals/picojson/picojson.h similarity index 100% rename from externals/picojson.h rename to externals/picojson/picojson.h diff --git a/externals/z3-LICENSE b/externals/z3-LICENSE new file mode 100644 index 000000000..cc90bed74 --- /dev/null +++ b/externals/z3-LICENSE @@ -0,0 +1,10 @@ +Z3 +Copyright (c) Microsoft Corporation +All rights reserved. +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 6a8167c76..e614b2487 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,5 @@ include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/) +include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/picojson/) include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) diff --git a/lib/cppcheck.vcxproj b/lib/cppcheck.vcxproj index 7a8fd9464..25513c3c6 100644 --- a/lib/cppcheck.vcxproj +++ b/lib/cppcheck.vcxproj @@ -293,7 +293,7 @@ Disabled CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) Level4 - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 MultiThreadedDebugDLL Use @@ -324,7 +324,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y Disabled CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions) Level4 - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 MultiThreadedDebugDLL Use @@ -355,7 +355,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y Disabled CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) Level4 - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 MultiThreadedDebugDLL Use @@ -384,7 +384,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y Disabled CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) Level4 - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 MultiThreadedDebugDLL Use @@ -417,7 +417,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true true - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) MultiThreadedDLL @@ -457,7 +457,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true true - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions) MultiThreadedDLL @@ -498,7 +498,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true true - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDLL @@ -537,7 +537,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true true - ..\externals;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) + ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml;%(AdditionalIncludeDirectories) 4018;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 09af56b3d..26898db61 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -59,10 +59,11 @@ static void getDeps(const std::string &filename, std::vector &depfi if (filename == "externals/z3_version.h") return; - static const std::vector externalfolders = {"externals", - "externals/simplecpp", - "externals/tinyxml" - }; + static const std::vector externalfolders{"externals", + "externals/picojson", + "externals/simplecpp", + "externals/tinyxml" + }; // Is the dependency already included? if (std::find(depfiles.begin(), depfiles.end(), filename) != depfiles.end()) @@ -386,7 +387,7 @@ int main(int argc, char **argv) << "endif\n\n"; makeConditionalVariable(fout, "PREFIX", "/usr"); - makeConditionalVariable(fout, "INCLUDE_FOR_LIB", "-Ilib -isystem externals -isystem externals/simplecpp -isystem externals/tinyxml"); + makeConditionalVariable(fout, "INCLUDE_FOR_LIB", "-Ilib -isystem externals -isystem externals/picojson -isystem externals/simplecpp -isystem externals/tinyxml"); makeConditionalVariable(fout, "INCLUDE_FOR_CLI", "-Ilib -isystem externals/simplecpp -isystem externals/tinyxml"); makeConditionalVariable(fout, "INCLUDE_FOR_TEST", "-Ilib -Icli -isystem externals/simplecpp -isystem externals/tinyxml"); diff --git a/win_installer/cppcheck.wxs b/win_installer/cppcheck.wxs index 4d1725726..44808c6ca 100644 --- a/win_installer/cppcheck.wxs +++ b/win_installer/cppcheck.wxs @@ -156,6 +156,10 @@ + + + +