BuildSystem: Fix enable sse definition

__enable_sse was never actually defined for any targets. This also adds
__arch definition for libc (so `utsname` works).
This commit is contained in:
Bananymous 2024-08-09 15:16:49 +03:00
parent 7e7c3a1bb3
commit 2a659a9d03
3 changed files with 12 additions and 3 deletions

View File

@ -4,8 +4,7 @@ if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "banan-os")
message(FATAL_ERROR "CMAKE_SYSTEM_NAME is not banan-os")
endif ()
#add_compile_options(-mno-sse -mno-sse2)
add_compile_definitions(__enable_sse=1)
set(BANAN_ENABLE_SSE 1)
project(banan-os CXX C ASM)

View File

@ -172,7 +172,11 @@ set(KERNEL_SOURCES
add_executable(kernel ${KERNEL_SOURCES})
target_compile_definitions(kernel PUBLIC __is_kernel)
target_compile_definitions(kernel PUBLIC __arch=${BANAN_ARCH})
target_compile_definitions(kernel PRIVATE __arch=${BANAN_ARCH})
target_compile_definitions(kernel PRIVATE __enable_sse=${BANAN_ENABLE_SSE})
if (NOT BANAN_ENABLE_SSE)
target_compile_options(kernel PRIVATE -mno-sse -mno-sse2)
endif ()
target_compile_options(kernel PUBLIC -O2 -g)
target_compile_options(kernel PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-Wno-literal-suffix -fno-rtti -fno-exceptions>)

View File

@ -36,6 +36,12 @@ set(LIBC_SOURCES
)
add_library(libc ${LIBC_SOURCES})
target_compile_definitions(libc PRIVATE __arch=${BANAN_ARCH})
target_compile_definitions(libc PRIVATE __enable_sse=${BANAN_ENABLE_SSE})
if (NOT BANAN_ENABLE_SSE)
target_compile_options(libc PRIVATE -mno-sse -mno-sse2)
endif ()
target_compile_options(libc PRIVATE -O2 -g -Wstack-usage=512 -fno-tree-loop-distribute-patterns -fno-exceptions -nostdlib)
target_compile_options(libc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=)