Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Use list(APPEND FOO) over set(FOO ${FOO} ...) #2056

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ include(VERSION.cmake)
project(dnf5 LANGUAGES CXX C VERSION ${VERSION_PRIME}.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO})
cmake_policy(VERSION ${CMAKE_VERSION})

set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set (SYSTEMD_DIR "/usr/lib/systemd/system")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(SYSTEMD_DIR "/usr/lib/systemd/system")

message("Building ${PROJECT_NAME} version ${PROJECT_VERSION}")

Expand Down
4 changes: 2 additions & 2 deletions bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ set(SWIG_COMPILE_OPTIONS
)

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(SWIG_COMPILE_OPTIONS ${SWIG_COMPILE_OPTIONS}
list(APPEND SWIG_COMPILE_OPTIONS
-Wno-deprecated-volatile
-Wno-unknown-warning-option
)
else()
set(SWIG_COMPILE_OPTIONS ${SWIG_COMPILE_OPTIONS}
list(APPEND SWIG_COMPILE_OPTIONS
-Wno-catch-value
-Wno-maybe-uninitialized
-Wno-volatile
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ message("Building bindings for go")
function(add_go_module LIBRARY_NAME MODULE_NAME)
set(TARGET_NAME "go_${MODULE_NAME}")
set_source_files_properties(../../${LIBRARY_NAME}/${MODULE_NAME}.i PROPERTIES CPLUSPLUS ON)
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS}
list(APPEND CMAKE_SWIG_FLAGS
-module ${TARGET_NAME} -cgo -intgosize 64 -package libdnf5
)
swig_add_library(${TARGET_NAME} LANGUAGE go SOURCES ../../${LIBRARY_NAME}/${MODULE_NAME}.i)
Expand Down
6 changes: 3 additions & 3 deletions bindings/python3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include_directories(${Python3_INCLUDE_DIRS})

function(add_python3_module LIBRARY_NAME MODULE_NAME)
set(TARGET_NAME "python3_${MODULE_NAME}")
set(SWIG_COMPILE_OPTIONS ${SWIG_COMPILE_OPTIONS}
list(APPEND SWIG_COMPILE_OPTIONS
-Wno-redundant-decls
)
# Currently the SWIG_PYTHON_SILENT_MEMLEAK controls only whether message:
Expand All @@ -28,10 +28,10 @@ function(add_python3_module LIBRARY_NAME MODULE_NAME)
# print the message
# There is an issue reported on SWIG with the same root cause: https://github.com/swig/swig/issues/2037 it
# also contains more details.
set(SWIG_COMPILE_OPTIONS ${SWIG_COMPILE_OPTIONS}
list(APPEND SWIG_COMPILE_OPTIONS
-DSWIG_PYTHON_SILENT_MEMLEAK
)
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS}
list(APPEND CMAKE_SWIG_FLAGS
-doxygen
)
set_source_files_properties(../../${LIBRARY_NAME}/${MODULE_NAME}.i PROPERTIES CPLUSPLUS ON)
Expand Down