mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
CMake: Add macro to wrap C++ command line definitions for swiftc
Similar to the existing macros for compile options and link options, this macro wraps the command line definitions for swiftc in a way that avoids warnings about conditional compilation flags not having values.
This commit is contained in:
parent
d454108fcd
commit
5dc673e0c2
4 changed files with 12 additions and 3 deletions
|
@ -14,6 +14,15 @@ macro(add_cxx_compile_options)
|
||||||
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX,ASM>:${args}>)
|
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX,ASM>:${args}>)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(add_cxx_compile_definitions)
|
||||||
|
set(args "")
|
||||||
|
foreach(arg ${ARGN})
|
||||||
|
string(APPEND args ${arg}$<SEMICOLON>)
|
||||||
|
add_compile_options("SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -D${arg}>")
|
||||||
|
endforeach()
|
||||||
|
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX,ASM>:${args}>)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
macro(add_cxx_link_options)
|
macro(add_cxx_link_options)
|
||||||
set(args "")
|
set(args "")
|
||||||
foreach(arg ${ARGN})
|
foreach(arg ${ARGN})
|
||||||
|
|
|
@ -3,5 +3,5 @@ include_guard()
|
||||||
if (NOT APPLE AND NOT ANDROID)
|
if (NOT APPLE AND NOT ANDROID)
|
||||||
find_package(Fontconfig REQUIRED)
|
find_package(Fontconfig REQUIRED)
|
||||||
set(HAS_FONTCONFIG ON CACHE BOOL "" FORCE)
|
set(HAS_FONTCONFIG ON CACHE BOOL "" FORCE)
|
||||||
add_compile_definitions(USE_FONTCONFIG=1)
|
add_cxx_compile_definitions(USE_FONTCONFIG=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -18,7 +18,7 @@ if (NOT WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LINUX)
|
if (LINUX)
|
||||||
add_compile_definitions(_FILE_OFFSET_BITS=64)
|
add_cxx_compile_definitions(_FILE_OFFSET_BITS=64)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|
|
@ -5,6 +5,6 @@ if (NOT APPLE)
|
||||||
find_package(Vulkan QUIET)
|
find_package(Vulkan QUIET)
|
||||||
if (VulkanHeaders_FOUND AND Vulkan_FOUND)
|
if (VulkanHeaders_FOUND AND Vulkan_FOUND)
|
||||||
set(HAS_VULKAN ON CACHE BOOL "" FORCE)
|
set(HAS_VULKAN ON CACHE BOOL "" FORCE)
|
||||||
add_compile_definitions(USE_VULKAN=1)
|
add_cxx_compile_definitions(USE_VULKAN=1)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue