Skip to content

Commit

Permalink
Fix handling of tools.build:defines for multiconfig CMake (#15921)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenwdv committed Mar 22, 2024
1 parent 5902909 commit 19b7cf6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions conan/tools/cmake/toolchain/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def context(self):

if not config_dict:
return None

vs_debugger_path = ""
for config, value in config_dict.items():
vs_debugger_path += f"$<$<CONFIG:{config}>:{value}>"
Expand Down Expand Up @@ -613,7 +613,10 @@ class ExtraFlagsBlock(Block):
{% endif %}
{% if defines %}
{% if config %}
add_compile_definitions($<$<CONFIG:{{config}}>:{% for define in defines %}" {{ define }}"{% endfor %}>)
add_compile_definitions(
{%- for define in defines %}
"$<$<CONFIG:{{config}}>:{{define}}>"
{%- endfor -%})
{% else %}
add_compile_definitions({% for define in defines %} "{{ define }}"{% endfor %})
{% endif %}
Expand Down

0 comments on commit 19b7cf6

Please sign in to comment.