Skip to content
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
3 changes: 1 addition & 2 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This document outlines the style conventions used in the CMake configuration fil
## 2. Indentation, Control Flow, and Line Wrapping
* **Indentation:** 2-space indentation is used for commands inside control blocks (like `if` / `endif`).
* **Control Flow:** Closing commands (e.g., `endif()`, `endforeach()`, `endmacro()`, `endfunction()`) must not repeat the condition or arguments of the opening command (e.g., use `endif()` instead of `endif(config_DEBUG)`).
* **Argument Wrapping:**
* **Argument Wrapping:**
* Short, simple commands are kept on a single line (e.g., `set(CMAKE_C_STANDARD 11)`).
* Long commands or those with multiple arguments/keywords are wrapped, with each argument placed on a new line and indented by 2 spaces relative to the command (e.g., `add_executable`, `target_include_directories`).
* The closing parenthesis `)` is either placed on the same line as the last argument or on its own line aligned with the command name (usually in block-style commands like `install` or `set_target_properties`).
Expand All @@ -27,4 +27,3 @@ This document outlines the style conventions used in the CMake configuration fil

## 6. Target-Based Configuration
* **Prefer target-based configuration:** Define compile options, compile definitions, include directories, and link libraries on specific targets using `target_*` commands (e.g., `target_include_directories`, `target_compile_options`, `target_compile_definitions`, `target_link_libraries`) rather than modifying global/directory-wide settings (e.g., `add_compile_options`).

6 changes: 6 additions & 0 deletions src/plist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ target_include_directories(
# TODO(kaeser@gubbe.ch):Remove, once updating post bison 3.8.2 (Aug 2022).
# See: https://github.com/phkaeser/wlmaker/issues/53
target_compile_options(libbase_plist PRIVATE -Wno-unused-but-set-variable)
if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
set_source_files_properties(
"${CMAKE_CURRENT_BINARY_DIR}/analyzer.c"
"${CMAKE_CURRENT_BINARY_DIR}/grammar.c"
PROPERTIES COMPILE_OPTIONS "-Wno-error")
endif()
target_link_libraries(libbase_plist PRIVATE libbase libbase_compiler_flags)
set_target_properties(
libbase_plist
Expand Down
Loading