diff --git a/Meta/CMake/common_compile_options.cmake b/Meta/CMake/common_compile_options.cmake index 30863769dfb..87c01fd9224 100644 --- a/Meta/CMake/common_compile_options.cmake +++ b/Meta/CMake/common_compile_options.cmake @@ -14,6 +14,15 @@ macro(add_cxx_compile_options) add_compile_options($<$:${args}>) endmacro() +macro(add_cxx_compile_definitions) + set(args "") + foreach(arg ${ARGN}) + string(APPEND args ${arg}$) + add_compile_options("SHELL:$<$:-Xcc -D${arg}>") + endforeach() + add_compile_definitions($<$:${args}>) +endmacro() + macro(add_cxx_link_options) set(args "") foreach(arg ${ARGN}) diff --git a/Meta/CMake/fontconfig.cmake b/Meta/CMake/fontconfig.cmake index 4ea63d69bee..84556ae59b2 100644 --- a/Meta/CMake/fontconfig.cmake +++ b/Meta/CMake/fontconfig.cmake @@ -3,5 +3,5 @@ include_guard() if (NOT APPLE AND NOT ANDROID) find_package(Fontconfig REQUIRED) set(HAS_FONTCONFIG ON CACHE BOOL "" FORCE) - add_compile_definitions(USE_FONTCONFIG=1) + add_cxx_compile_definitions(USE_FONTCONFIG=1) endif() diff --git a/Meta/CMake/lagom_compile_options.cmake b/Meta/CMake/lagom_compile_options.cmake index 022d32c2f57..671d39e729c 100644 --- a/Meta/CMake/lagom_compile_options.cmake +++ b/Meta/CMake/lagom_compile_options.cmake @@ -18,7 +18,7 @@ if (NOT WIN32) endif() if (LINUX) - add_compile_definitions(_FILE_OFFSET_BITS=64) + add_cxx_compile_definitions(_FILE_OFFSET_BITS=64) endif() if (APPLE) diff --git a/Meta/CMake/vulkan.cmake b/Meta/CMake/vulkan.cmake index c9847706dce..41b457f9353 100644 --- a/Meta/CMake/vulkan.cmake +++ b/Meta/CMake/vulkan.cmake @@ -5,6 +5,6 @@ if (NOT APPLE) find_package(Vulkan QUIET) if (VulkanHeaders_FOUND AND Vulkan_FOUND) set(HAS_VULKAN ON CACHE BOOL "" FORCE) - add_compile_definitions(USE_VULKAN=1) + add_cxx_compile_definitions(USE_VULKAN=1) endif() endif()