2024-11-21 11:00:48 +10:30
|
|
|
#[=======================================================================[.rst:
|
|
|
|
|
Linux
|
|
|
|
|
-----
|
|
|
|
|
|
|
|
|
|
This file contains functions for options and configuration for targeting the
|
|
|
|
|
Linux platform
|
|
|
|
|
|
|
|
|
|
]=======================================================================]
|
2025-03-02 12:04:30 +10:30
|
|
|
|
|
|
|
|
#[=============================[ Linux Options ]=============================]
|
2025-02-04 11:53:45 +10:30
|
|
|
function(linux_options)
|
2025-03-02 12:04:30 +10:30
|
|
|
#[[ Options from SCons
|
|
|
|
|
use_llvm : Use the LLVM compiler
|
|
|
|
|
Not implemented as compiler selection is managed by CMake. Look to
|
2025-10-05 11:10:29 +02:00
|
|
|
the docs (https://docs.godotengine.org/en/latest/tutorials/scripting/cpp/build_system/cmake.html)
|
|
|
|
|
for examples.
|
2025-03-02 12:04:30 +10:30
|
|
|
]]
|
2025-11-01 08:31:46 -05:00
|
|
|
option(GODOTCPP_USE_STATIC_CPP "Link libgcc and libstdc++ statically for better portability" OFF)
|
2024-11-21 11:00:48 +10:30
|
|
|
endfunction()
|
|
|
|
|
|
2025-03-02 12:04:30 +10:30
|
|
|
#[===========================[ Target Generation ]===========================]
|
2025-02-04 11:53:45 +10:30
|
|
|
function(linux_generate)
|
2025-03-18 18:44:28 +01:00
|
|
|
set(STATIC_CPP "$<BOOL:${GODOTCPP_USE_STATIC_CPP}>")
|
|
|
|
|
|
2025-03-09 12:31:56 +10:30
|
|
|
target_compile_definitions(godot-cpp PUBLIC LINUX_ENABLED UNIX_ENABLED)
|
2024-11-21 11:00:48 +10:30
|
|
|
|
2025-03-18 18:44:28 +01:00
|
|
|
# gersemi: off
|
|
|
|
|
target_link_options(
|
|
|
|
|
godot-cpp
|
|
|
|
|
PUBLIC
|
|
|
|
|
$<${STATIC_CPP}:
|
|
|
|
|
-static-libgcc
|
|
|
|
|
-static-libstdc++
|
|
|
|
|
>
|
|
|
|
|
)
|
|
|
|
|
# gersemi: on
|
|
|
|
|
|
2024-12-11 10:40:21 +10:30
|
|
|
common_compiler_flags()
|
2024-11-21 11:00:48 +10:30
|
|
|
endfunction()
|