set(FREESTANDING_SOURCES Format.cpp NumberParsing.cpp String.cpp Units.cpp SystemError.cpp ) set(SOURCES ${FREESTANDING_SOURCES} Check.cpp ) add_library(luna-freestanding ${FREESTANDING_SOURCES}) target_compile_definitions(luna-freestanding PRIVATE USE_FREESTANDING) target_compile_options(luna-freestanding PRIVATE -Wall -Wextra -Werror -Wvla) target_compile_options(luna-freestanding PRIVATE -Wdisabled-optimization -Wformat=2 -Winit-self) target_compile_options(luna-freestanding PRIVATE -Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef) target_compile_options(luna-freestanding PRIVATE -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion) target_compile_options(luna-freestanding PRIVATE -fno-rtti -ffreestanding -fno-exceptions) target_compile_options(luna-freestanding PRIVATE -fno-asynchronous-unwind-tables -fno-omit-frame-pointer) target_compile_options(luna-freestanding PRIVATE -nostdlib -mcmodel=kernel) if("${ARCH}" MATCHES "x86_64") target_compile_options(luna-freestanding PRIVATE -mno-red-zone) target_compile_options(luna-freestanding PRIVATE -mno-80387 -mno-mmx -mno-sse -mno-sse2) endif() target_include_directories(luna-freestanding PUBLIC ${LUNA_ROOT}/luna) set_target_properties(luna-freestanding PROPERTIES CXX_STANDARD 20) add_library(luna ${SOURCES}) target_compile_options(luna PRIVATE -Wall -Wextra -Werror -Wvla) target_compile_options(luna PRIVATE -Wdisabled-optimization -Wformat=2 -Winit-self) target_compile_options(luna PRIVATE -Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef) target_compile_options(luna PRIVATE -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion) target_compile_options(luna PRIVATE -fno-asynchronous-unwind-tables -fno-omit-frame-pointer) target_include_directories(luna PUBLIC ${LUNA_ROOT}/luna) set_target_properties(luna PROPERTIES CXX_STANDARD 20)