Skip to content

Commit

Permalink
Fix handling of tools.build:defines for (Ninja) multi-config CMake
Browse files Browse the repository at this point in the history
The CMake generator-expressions that results from the values given to
Conan's `tools.build:defines` configuration will now properly be put
into quotes to form a CMake string. (Note: CMake's generator-expressions
should never contain any (non-escaped) quotes.)
  • Loading branch information
DenizThatMenace committed Jul 9, 2024
1 parent dd28339 commit ed1c66a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conan/tools/cmake/toolchain/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ class ExtraFlagsBlock(Block):
{% if defines %}
{% if config %}
{% for define in defines %}
add_compile_definitions($<$<CONFIG:{{config}}>:"{{ define }}">)
add_compile_definitions("$<$<CONFIG:{{config}}>:{{ define }}>")
{% endfor %}
{% else %}
add_compile_definitions({% for define in defines %} "{{ define }}"{% endfor %})
Expand Down

0 comments on commit ed1c66a

Please sign in to comment.