Skip to content

Commit 0220ee6

Browse files
committed
fixed unitialized CMake variables
1 parent 574c8c1 commit 0220ee6

5 files changed

Lines changed: 20 additions & 6 deletions

File tree

cmake/clang_tidy.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ if(RUN_CLANG_TIDY_NAMES)
4040
set(CLANG_TIDY_CSA_CONFIG "-config={InheritParentConfig: true, Checks: '-*,clang-analyzer-*,-clang-analyzer-core.CallAndMessage,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-core.NullDereference,-clang-analyzer-unix.Stream,-clang-analyzer-alpha.clone.CloneChecker,-clang-analyzer-alpha.webkit.*'}")
4141
if (ENABLE_CSA_ALPHA)
4242
set(CLANG_TIDY_CSA_ALPHA_OPTS "-allow-enabling-alpha-checkers" "-extra-arg=-Xclang" "-extra-arg=-analyzer-config" "-extra-arg=-Xclang" "-extra-arg=aggressive-binary-operation-simplification=true")
43+
else()
44+
set(CLANG_TIDY_CSA_ALPHA_OPTS "")
4345
endif()
4446

4547
# TODO: exclude moc_*.cpp

cmake/findDependencies.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ if(HAVE_RULES)
3434
if(NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE)
3535
message(FATAL_ERROR "pcre dependency for RULES has not been found")
3636
endif()
37+
else()
38+
set(PCRE_LIBRARY "")
3739
endif()
3840

3941
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -70,6 +72,9 @@ if(NOT USE_BUNDLED_TINYXML2)
7072
endif()
7173

7274
find_package(Threads REQUIRED)
75+
if(NOT DEFINED CMAKE_THREAD_LIBS_INIT)
76+
set(CMAKE_THREAD_LIBS_INIT "")
77+
endif()
7378

7479
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30")
7580
# avoid legacy warning about Boost lookup in CMake
@@ -90,7 +95,7 @@ if(USE_BOOST)
9095
endif()
9196
set(Boost_FOUND ON)
9297
set(Boost_INCLUDE_DIRS "${BOOST_INCLUDEDIR}")
93-
# TODO: set Boost_VERSION_STRING
98+
set(Boost_VERSION_STRING "") # TODO: set proper value
9499
elseif(USE_BOOST STREQUAL "Auto")
95100
find_package(Boost)
96101
else()

cmake/printInfo.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ if(BUILD_GUI)
6969
message(STATUS "QT_VERSION = ${QT_VERSION}")
7070
message(STATUS "Qt6Core_LIBRARIES = ${Qt6Core_LIBRARIES}")
7171
message(STATUS "Qt6Core_INCLUDE_DIRS = ${Qt6Core_INCLUDE_DIRS}")
72-
message(STATUS "QHELPGENERATOR = ${QHELPGENERATOR}")
72+
if(BUILD_ONLINE_HELP)
73+
message(STATUS "QHELPGENERATOR = ${QHELPGENERATOR}")
74+
endif()
7375
endif()
7476
message(STATUS)
7577
message(STATUS "HAVE_RULES = ${HAVE_RULES}")
@@ -90,9 +92,11 @@ message(STATUS)
9092
message(STATUS "USE_BOOST = ${USE_BOOST}")
9193
if(USE_BOOST)
9294
message(STATUS "Boost_FOUND = ${Boost_FOUND}")
93-
message(STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING}")
94-
message(STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}")
95-
message(STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128}")
95+
if(Boost_FOUND)
96+
message(STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING}")
97+
message(STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}")
98+
message(STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128}")
99+
endif()
96100
endif()
97101
message(STATUS)
98102
message(STATUS "USE_LIBCXX = ${USE_LIBCXX}")

lib/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function(build_src output filename)
1212
set(${output} ${${output}} ${outfile} PARENT_SCOPE)
1313
if (USE_MATCHCOMPILER_OPT STREQUAL "Verify")
1414
set(verify_option "--verify")
15+
else()
16+
set(verify_option "")
1517
endif()
1618
add_custom_command(
1719
OUTPUT ${outfile}
@@ -28,6 +30,7 @@ function(build_src output filename)
2830
endfunction()
2931

3032
if (NOT USE_MATCHCOMPILER_OPT STREQUAL "Off")
33+
set(srcs_build "")
3134
foreach(file ${srcs})
3235
build_src(srcs_build ${file})
3336
endforeach()

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if (BUILD_TESTING)
7979
set(oneValueArgs PLATFORM NAME)
8080
set(multiValueArgs ADD_LIBRARY)
8181

82-
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
82+
cmake_parse_arguments(PARSE "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
8383
get_filename_component(LIBRARY ${CFG_TEST} NAME_WE)
8484
# TODO: get rid of this
8585
if(PARSE_ADD_LIBRARY)

0 commit comments

Comments
 (0)