Skip to content

Commit

Permalink
Renames libcore to libgui and move it to top-level (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Oct 1, 2024
1 parent 709c0b7 commit c8ce13a
Show file tree
Hide file tree
Showing 49 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = [
"src/core",
"gui",
"src/fs",
"src/gmtx",
"src/kernel",
Expand Down
8 changes: 4 additions & 4 deletions src/core/Cargo.toml → gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "core"
name = "gui"
version = "0.1.0"
edition = "2021"

Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/core/build.rs → gui/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit c8ce13a

Please sign in to comment.