mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Ports: Fix CMake-based ports
The SDL port failed to build because the CMake toolchain filed pointed to the old root. Now the toolchain file assumes that the Root is in Build/Root. Additionally, the AK/ and Kernel/ headers need to be installed in the root too.
This commit is contained in:
parent
b0b03c52af
commit
4d4e578edf
Notes:
sideshowbarker
2024-07-19 05:59:15 +09:00
Author: https://github.com/predmond Commit: https://github.com/SerenityOS/serenity/commit/4d4e578edfd
1
AK/CMakeLists.txt
Normal file
1
AK/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
serenity_install_headers(AK)
|
@ -40,7 +40,7 @@ add_subdirectory(DevTools/FormCompiler)
|
||||
add_subdirectory(Libraries/LibWeb/CodeGenerators)
|
||||
add_subdirectory(AK/Tests)
|
||||
|
||||
function(serenity_lib_headers target_name)
|
||||
function(serenity_install_headers target_name)
|
||||
file(GLOB_RECURSE headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
|
||||
foreach(header ${headers})
|
||||
get_filename_component(subdirectory ${header} DIRECTORY)
|
||||
@ -49,7 +49,7 @@ function(serenity_lib_headers target_name)
|
||||
endfunction()
|
||||
|
||||
function(serenity_lib target_name fs_name)
|
||||
serenity_lib_headers(${target_name})
|
||||
serenity_install_headers(${target_name})
|
||||
add_library(${target_name} ${SOURCES} ${GENERATED_SOURCES})
|
||||
install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib)
|
||||
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name})
|
||||
@ -63,7 +63,7 @@ function(serenity_lib target_name fs_name)
|
||||
endfunction()
|
||||
|
||||
function(serenity_libc target_name fs_name)
|
||||
serenity_lib_headers("")
|
||||
serenity_install_headers("")
|
||||
add_library(${target_name} ${SOURCES})
|
||||
install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib)
|
||||
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name})
|
||||
@ -121,6 +121,7 @@ include_directories(Services)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/Services)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/Libraries)
|
||||
|
||||
add_subdirectory(AK)
|
||||
add_subdirectory(Kernel)
|
||||
add_subdirectory(Libraries)
|
||||
add_subdirectory(Services)
|
||||
|
@ -181,4 +181,6 @@ add_custom_command(
|
||||
)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kernel.map DESTINATION res)
|
||||
|
||||
serenity_install_headers(Kernel)
|
||||
|
||||
add_subdirectory(Modules)
|
||||
|
@ -7,10 +7,10 @@ endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")
|
||||
|
||||
# where to read from/write to
|
||||
set(CMAKE_SYSROOT $ENV{SERENITY_ROOT}/Root)
|
||||
set(CMAKE_STAGING_PREFIX $ENV{SERENITY_ROOT}/Root/usr)
|
||||
set(CMAKE_INSTALL_PREFIX $ENV{SERENITY_ROOT}/Root/usr)
|
||||
set(CMAKE_INSTALL_DATAROOTDIR $ENV{SERENITY_ROOT}/Root/usr/share)
|
||||
set(CMAKE_SYSROOT $ENV{SERENITY_ROOT}/Build/Root)
|
||||
set(CMAKE_STAGING_PREFIX $ENV{SERENITY_ROOT}/Build/Root/usr)
|
||||
set(CMAKE_INSTALL_PREFIX $ENV{SERENITY_ROOT}/Build/Root/usr)
|
||||
set(CMAKE_INSTALL_DATAROOTDIR $ENV{SERENITY_ROOT}/Build/Root/usr/share)
|
||||
|
||||
set(CMAKE_C_COMPILER i686-pc-serenity-gcc)
|
||||
set(CMAKE_CXX_COMPILER i686-pc-serenity-g++)
|
||||
|
Loading…
Reference in New Issue
Block a user