Renames libcore to libgui and move it to top-level (#1008)

This commit is contained in:
Putta Khunchalee 2024-10-01 13:11:41 +07:00 committed by GitHub
parent 709c0b708d
commit c8ce13a7bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
49 changed files with 17 additions and 17 deletions

View File

@ -20,7 +20,7 @@ jobs:
run: cargo clippy --package obkrnl --target x86_64-unknown-none -- -D warnings
working-directory: src
- name: Run tests
run: cargo test --workspace --exclude core --exclude kernel
run: cargo test --workspace --exclude gui --exclude kernel
working-directory: src
- name: Add Flathub
run: flatpak remote-add --user flathub https://flathub.org/repo/flathub.flatpakrepo

View File

@ -80,7 +80,7 @@ jobs:
- name: Build
run: cmake --build --preset mac-release
- name: Run tests
run: cargo test --workspace --exclude core --exclude kernel
run: cargo test --workspace --exclude gui --exclude kernel
working-directory: src
- name: Create Application Bundle
run: |

View File

@ -71,7 +71,7 @@ jobs:
- name: Build
run: cmake --build --preset windows-release
- name: Run tests
run: cargo test --workspace --exclude core --exclude kernel
run: cargo test --workspace --exclude gui --exclude kernel
working-directory: src
- name: Export artifacts
run: cmake --install build --prefix dist

View File

@ -41,22 +41,22 @@ set(KERNEL ${KERNEL_OUTPUTS}/obkrnl)
set(HOST_OUTPUTS $<IF:$<CONFIG:Debug>,${CMAKE_CURRENT_SOURCE_DIR}/target/debug,${CMAKE_CURRENT_SOURCE_DIR}/target/release>)
if(WIN32)
set(LIBCORE ${HOST_OUTPUTS}/core.lib)
set(LIBGUI ${HOST_OUTPUTS}/gui.lib)
else()
set(LIBCORE ${HOST_OUTPUTS}/libcore.a)
set(LIBGUI ${HOST_OUTPUTS}/libgui.a)
endif()
add_custom_target(core
add_custom_target(libgui
COMMAND cargo build $<IF:$<CONFIG:Debug>,--profile=dev,--release>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/core
BYPRODUCTS ${LIBCORE})
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gui
BYPRODUCTS ${LIBGUI})
add_custom_target(kernel
COMMAND cargo ${KERNEL_TOOLCHAIN} build $<IF:$<CONFIG:Debug>,--profile=dev,--release> --target ${KERNEL_TARGET} ${KERNEL_OPTS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/obkrnl
BYPRODUCTS ${KERNEL})
add_dependencies(core kernel)
add_dependencies(libgui kernel)
# Add GUI.
add_subdirectory(src)

View File

@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = [
"src/core",
"gui",
"src/fs",
"src/gmtx",
"src/kernel",

View File

@ -1,5 +1,5 @@
[package]
name = "core"
name = "gui"
version = "0.1.0"
edition = "2021"
@ -10,10 +10,10 @@ crate-type = ["staticlib"]
bitfield-struct = "0.8.0"
humansize = "2.1.3"
libc = "0.2.155"
obconf = { path = "../obconf", features = ["serde", "virt"] }
obconf = { path = "../src/obconf", features = ["serde", "virt"] }
obfw = { git = "https://github.com/obhq/firmware-dumper.git", features = ["read", "std"] }
param = { path = "../param" }
pkg = { path = "../pkg" }
param = { path = "../src/param" }
pkg = { path = "../src/pkg" }
ciborium = "0.2.2"
serde = { version = "1.0.209", features = ["derive"] }
thiserror = "1.0"

View File

@ -51,5 +51,5 @@ fn main() {
.with_config(conf)
.generate()
.unwrap()
.write_to_file(root.join("core.h"));
.write_to_file(root.join("src").join("core.h"));
}

View File

@ -43,7 +43,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_sources(obliteration PRIVATE kvm.cpp vulkan.cpp)
endif()
add_dependencies(obliteration core)
add_dependencies(obliteration libgui)
set_target_properties(obliteration PROPERTIES AUTOMOC ON AUTORCC ON)
@ -66,7 +66,7 @@ target_compile_features(obliteration PRIVATE cxx_std_17)
target_link_libraries(obliteration PRIVATE Qt6::Svg Qt6::Widgets)
target_link_libraries(obliteration PRIVATE Threads::Threads)
target_link_libraries(obliteration PRIVATE ${LIBCORE})
target_link_libraries(obliteration PRIVATE ${LIBGUI})
if(WIN32)
target_link_libraries(obliteration PRIVATE bcrypt imm32 ntdll setupapi userenv version winhvplatform winmm ws2_32)