mirror of
https://github.com/obhq/obliteration.git
synced 2024-11-26 20:50:22 +00:00
Uses Corrosion to build libgui (#1058)
This commit is contained in:
parent
c2cc076d80
commit
01693fa90d
2
.github/workflows/ci-mac.yml
vendored
2
.github/workflows/ci-mac.yml
vendored
@ -84,7 +84,7 @@ jobs:
|
||||
working-directory: src
|
||||
- name: Create Application Bundle
|
||||
run: |
|
||||
cmake --install build --prefix .
|
||||
cmake --install build --prefix "$(pwd)"
|
||||
mkdir dist
|
||||
mv obliteration.app dist/Obliteration.app
|
||||
- name: Fix library paths
|
||||
|
@ -1,15 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
# Fetch external CMake scripts.
|
||||
FetchContent_Declare(
|
||||
corrosion
|
||||
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
msvc
|
||||
GIT_REPOSITORY https://github.com/MarkSchofield/WindowsToolchain.git
|
||||
GIT_TAG v0.11.0
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(msvc)
|
||||
FetchContent_MakeAvailable(msvc corrosion)
|
||||
|
||||
# Set project properties.
|
||||
project(obliteration)
|
||||
@ -50,25 +55,13 @@ endif()
|
||||
|
||||
set(KERNEL_OUTPUTS $<IF:$<CONFIG:Debug>,${CMAKE_CURRENT_SOURCE_DIR}/target/${KERNEL_TARGET}/debug,${CMAKE_CURRENT_SOURCE_DIR}/target/${KERNEL_TARGET}/release>)
|
||||
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(LIBGUI ${HOST_OUTPUTS}/gui.lib)
|
||||
else()
|
||||
set(LIBGUI ${HOST_OUTPUTS}/libgui.a)
|
||||
endif()
|
||||
|
||||
add_custom_target(libgui
|
||||
COMMAND cargo build $<IF:$<CONFIG:Debug>,--profile=dev,--release>
|
||||
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}/kernel
|
||||
BYPRODUCTS ${KERNEL})
|
||||
|
||||
add_dependencies(libgui kernel)
|
||||
corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATES gui)
|
||||
|
||||
# Add GUI.
|
||||
add_subdirectory(gui)
|
||||
|
@ -10,7 +10,7 @@ if(APPLE)
|
||||
find_library(HYPERVISOR Hypervisor REQUIRED)
|
||||
endif()
|
||||
|
||||
# Setup application target.
|
||||
# Setup GUI.
|
||||
add_executable(obliteration WIN32 MACOSX_BUNDLE
|
||||
ansi_escape.cpp
|
||||
app_data.cpp
|
||||
@ -43,7 +43,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
target_sources(obliteration PRIVATE kvm.cpp vulkan.cpp)
|
||||
endif()
|
||||
|
||||
add_dependencies(obliteration libgui)
|
||||
add_dependencies(obliteration kernel)
|
||||
|
||||
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 ${LIBGUI})
|
||||
target_link_libraries(obliteration PRIVATE gui)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(obliteration PRIVATE bcrypt imm32 ntdll setupapi userenv version winhvplatform winmm ws2_32)
|
||||
|
Loading…
Reference in New Issue
Block a user