diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-07-04 00:55:59 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-07-06 22:21:50 +0200 |
| commit | 892ecce78dec37a1b2701611dd72986442cd094d (patch) | |
| tree | bbd7fb0a0229795bf52d0b8a9ff9b06251363a67 /src/CMakeLists.txt | |
| parent | 99554cc243c4b2ec290639a04ebc2f189890d6dd (diff) | |
| download | wnix-892ecce78dec37a1b2701611dd72986442cd094d.tar.gz | |
Import project skeleton from rts
https://gitea.privatedns.org/xavi/rts
Diffstat (limited to 'src/CMakeLists.txt')
| -rw-r--r-- | src/CMakeLists.txt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..51806be --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,43 @@ +# wanix, a Unix-like operating system for WebAssembly +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +# Avoid C11 since it is not supported by the i386-mingw32 toolchain. +set(cflags ${cflags} -Wall -ffunction-sections -fdata-sections -pedantic) + +set(components +) + +set(interfaces +) + +target_compile_options(${PROJECT_NAME} PUBLIC ${cflags}) +# Dependencies for main.c +# target_link_libraries(${PROJECT_NAME} PRIVATE) + +foreach(c ${components}) + add_subdirectory("${c}") + target_compile_options(${c} PUBLIC ${cflags}) + target_compile_features(${c} PUBLIC c_std_99) + set_target_properties(${c} PROPERTIES C_STANDARD 99 C_EXTENSIONS OFF) +endforeach() + +foreach(i ${interfaces}) + add_subdirectory("${i}") + target_compile_options(${i} INTERFACE ${cflags}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${c}) +endforeach() + +target_link_options(${PROJECT_NAME} PRIVATE -Wl,--gc-sections) |
