Add Changelog and remove flag.

This commit is contained in:
ArthurSonzogni
2025-04-09 12:35:46 +02:00
parent 84f691e9d3
commit 85c3dc45ca
4 changed files with 114 additions and 46 deletions

View File

@@ -1,21 +1,67 @@
file(GLOB_RECURSE FTXUI_MODULES *.cppm)
add_library(ftxui_modules)
cmake_minimum_required(VERSION 3.28)
if(NOT COMMAND configure_cpp_module_target)
function(configure_cpp_module_target target)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
target_sources(${target} PUBLIC FILE_SET CXX_MODULES FILES ${FTXUI_MODULES})
else()
message(WARNING "C++ modules require CMake 3.28+. Using standard compilation.")
target_sources(${target} PRIVATE ${FTXUI_MODULES})
endif()
endfunction()
# CMake 3.28+ supports the new CMake C++ module system.
if(CMAKE_VERSION VERSION_LESS 3.28)
return()
endif()
configure_cpp_module_target(ftxui_modules)
# Not all compilers support the C++ module system yet.
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU|MSVC")
return()
endif()
# The list of generators which support scanning sources for C++ modules include:
# - Ninja
# - Ninja Multi-Config
# - Visual Studio 17 2022
if (NOT (CMAKE_GENERATOR MATCHES "Ninja") AND
NOT (CMAKE_GENERATOR MATCHES "Visual Studio" AND
CMAKE_GENERATOR_VERSION VERSION_GREATER_EQUAL 17))
return()
endif()
cmake_minimum_required(VERSION 3.28)
add_library(ftxui_modules)
target_sources(ftxui_modules
PUBLIC
FILE_SET CXX_MODULES
FILES
component.cppm
component/Animation.cppm
component/CapturedMouse.cppm
component/Component.cppm
component/ComponentBase.cppm
component/ComponentOptions.cppm
component/Event.cppm
component/Loop.cppm
component/Mouse.cppm
component/Receiver.cppm
component/ScreenInteractive.cppm
component/Task.cppm
dom.cppm
dom/Canvas.cppm
dom/Deprecated.cppm
dom/Direction.cppm
dom/Elements.cppm
dom/FlexboxConfig.cppm
dom/LinearGradient.cppm
dom/Node.cppm
dom/Requirement.cppm
dom/Selection.cppm
dom/Table.cppm
screen.cppm
screen/Box.cppm
screen/Color.cppm
screen/ColorInfo.cppm
screen/Deprecated.cppm
screen/Image.cppm
screen/Pixel.cppm
screen/Screen.cppm
screen/String.cppm
screen/Terminal.cppm
util.cppm
util/AutoReset.cppm
util/Ref.cppm
)
target_link_libraries(ftxui_modules
PUBLIC
@@ -24,17 +70,14 @@ target_link_libraries(ftxui_modules
ftxui::component
)
target_include_directories(ftxui_modules
PRIVATE
${ftxui_SOURCE_DIR}/include
)
target_compile_features(ftxui_modules PUBLIC cxx_std_20)
set_target_properties(ftxui_modules PROPERTIES
CXX_STANDARD 23
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
CXX_MODULE_DYNDEP OFF
)
#set_target_properties(ftxui_modules PROPERTIES
#CXX_STANDARD 23
#CXX_STANDARD_REQUIRED ON
#CXX_EXTENSIONS OFF
#CXX_MODULE_DYNDEP OFF
#)
add_library(ftxui::modules ALIAS ftxui_modules)