diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9820c84..746b1bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# wanix, a Unix-like operating system for WebAssembly +# wanix, a Unix-like operating system for WebAssembly applications. # Copyright (C) 2025 Xavier Del Campo Romero # # This program is free software: you can redistribute it and/or modify @@ -24,10 +24,11 @@ ExternalProject_Add(tools CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=${TOOLS_PREFIX}) -project(wanix C) +project(wanix C ASM) +option(WANIX_BUILD_PROGRAMS "Build userspace programs" ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) -add_compile_options(-mno-gpopt) +add_compile_options(-mno-gpopt -ffunction-sections -fdata-sections) if(CMAKE_TOOLCHAIN_FILE MATCHES "ps1") set(PS1_BUILD 1) @@ -40,7 +41,7 @@ else() set(SDL1_2_BUILD 1) endif() -add_executable(${PROJECT_NAME} ${exec_flags} "src/main.c") +add_executable(${PROJECT_NAME} ${exec_flags} src/main.c) if(SDL1_2_BUILD) find_package(SDL 1.2 REQUIRED) @@ -62,12 +63,16 @@ set(cdroot ${CMAKE_BINARY_DIR}/cdimg) file(MAKE_DIRECTORY ${cdroot}) if(PS1_BUILD) - include("cmake/ps1.cmake") + include(cmake/ps1.cmake) elseif(WIN9X_BUILD) - include("cmake/win9x.cmake") + include(cmake/win9x.cmake) elseif(HOST_BUILD) - include("cmake/host.cmake") + include(cmake/host.cmake) endif() -add_subdirectory("res") -add_subdirectory("src") +add_subdirectory(res) +add_subdirectory(src) + +if(WANIX_BUILD_PROGRAMS) + add_subdirectory(programs) +endif() |
