Skip to content

Commit cc83c56

Browse files
build: Made solo5 optional (WITH_SOLO5). Always ON (except Mac). Solves #1399
1 parent 24aa7a3 commit cc83c56

6 files changed

Lines changed: 27 additions & 12 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ set(CMAKE_C_COMPILER_TARGET ${TRIPLE})
1717

1818
message(STATUS "Target triple ${TRIPLE}")
1919

20+
option(WITH_SOLO5 "Install with solo5 support" ON)
21+
2022
set(CMAKE_TOOLCHAIN_FILE ${INCLUDEOS_ROOT}/cmake/${ARCH}-elf-toolchain.cmake)
2123

2224
project (includeos C CXX)

cmake/cross_compiled_libraries.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ else(BUNDLE_LOC)
2828

2929
endif (BUNDLE_LOC)
3030

31+
if (WITH_SOLO5)
3132
ExternalProject_Add(solo5_repo
3233
PREFIX precompiled
3334
BUILD_IN_SOURCE 1
@@ -57,6 +58,13 @@ add_dependencies(ukvm-bin solo5_repo)
5758
# Some OS components depend on solo5 (for solo5.h for example)
5859
add_dependencies(PrecompiledLibraries solo5)
5960

61+
# Only x86_64 supported at the moment
62+
if ("${ARCH}" STREQUAL "x86_64")
63+
install(FILES ${SOLO5_LIB_DIR}/ukvm/solo5.o ${SOLO5_LIB_DIR}/ukvm/ukvm-bin DESTINATION includeos/${ARCH}/lib)
64+
endif()
65+
66+
endif (WITH_SOLO5)
67+
6068
set(PRECOMPILED_DIR ${CMAKE_CURRENT_BINARY_DIR}/precompiled/src/PrecompiledLibraries/${ARCH})
6169

6270
set(LIBCXX_INCLUDE_DIR ${PRECOMPILED_DIR}/libcxx/include/)
@@ -95,9 +103,4 @@ install(DIRECTORY ${SOLO5_INCLUDE_DIR} DESTINATION includeos/${ARCH}/include/sol
95103

96104
install(FILES ${CRTEND} ${CRTBEGIN} DESTINATION includeos/${ARCH}/lib)
97105

98-
# Only x86_64 supported at the moment
99-
if ("${ARCH}" STREQUAL "x86_64")
100-
install(FILES ${SOLO5_LIB_DIR}/ukvm/solo5.o ${SOLO5_LIB_DIR}/ukvm/ukvm-bin DESTINATION includeos/${ARCH}/lib)
101-
endif()
102-
103106
install(FILES ${NEWLIB_LIB_DIR}/libc.a ${NEWLIB_LIB_DIR}/libg.a ${NEWLIB_LIB_DIR}/libm.a ${LIBGCC_LIB_DIR}/libgcc.a ${LIBCXX_LIB_DIR}/libc++.a ${LIBCXX_LIB_DIR}/libc++abi.a DESTINATION includeos/${ARCH}/lib)

cmake/i686-elf-toolchain.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ set(CMAKE_FIND_ROOT_PATH ${INCLUDEOS_BIN})
4141

4242
# Set nasm compiler to the one symlinked in includeos/bin (to avoid running Mac one)
4343
set(CMAKE_ASM_NASM_COMPILER ${INCLUDEOS_BIN}/nasm)
44+
45+
# Disable solo5
46+
set(WITH_SOLO5 OFF CACHE BOOL "Install with solo5 support" FORCE)
4447
endif()

cmake/x86_64-elf-toolchain.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ set(CMAKE_FIND_ROOT_PATH ${INCLUDEOS_BIN})
4141

4242
# Set nasm compiler to the one symlinked in includeos/bin (to avoid running Mac one)
4343
set(CMAKE_ASM_NASM_COMPILER ${INCLUDEOS_BIN}/nasm)
44+
45+
# Disable solo5
46+
set(WITH_SOLO5 OFF CACHE BOOL "Install with solo5 support" FORCE)
4447
endif()

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ add_dependencies(os PrecompiledLibraries botan)
7676
add_subdirectory(arch/${ARCH})
7777
add_subdirectory(platform/x86_pc)
7878
add_subdirectory(platform/x86_nano)
79+
if(WITH_SOLO5)
7980
add_subdirectory(platform/x86_solo5)
81+
endif(WITH_SOLO5)
8082
add_subdirectory(drivers)
8183
add_subdirectory(plugins)
8284

src/drivers/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ add_dependencies(silent_start PrecompiledLibraries)
2222
add_library(vga_output STATIC vgaout.cpp)
2323
add_dependencies(vga_output PrecompiledLibraries)
2424

25-
add_library(solo5blk STATIC solo5blk.cpp)
26-
add_dependencies(solo5blk PrecompiledLibraries)
27-
28-
add_library(solo5net STATIC solo5net.cpp)
29-
add_dependencies(solo5net PrecompiledLibraries)
30-
3125
install(TARGETS
3226
virtionet virtioblk
33-
solo5net solo5blk
3427
vmxnet3
3528
heap_debugging
3629
silent_start vga_output
3730
DESTINATION includeos/${ARCH}/drivers)
31+
32+
if(WITH_SOLO5)
33+
add_library(solo5blk STATIC solo5blk.cpp)
34+
add_dependencies(solo5blk PrecompiledLibraries)
35+
36+
add_library(solo5net STATIC solo5net.cpp)
37+
add_dependencies(solo5net PrecompiledLibraries)
38+
install(TARGETS solo5net solo5blk DESTINATION includeos/${ARCH}/drivers)
39+
endif(WITH_SOLO5)

0 commit comments

Comments
 (0)