File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.16 )
2- project (BasicallyLinux C ASM_NASM )
32
4- # NASM flags for 32-bit ELF (Must be set before enable_language or forced)
3+ # Set NASM flags BEFORE the project() call to ensure they are used during initialization
54set (CMAKE_ASM_NASM_FLAGS "-f elf32" CACHE STRING "NASM flags" FORCE )
65
7- # Enable NASM support
8- enable_language (ASM_NASM )
6+ project (BasicallyLinux C ASM_NASM )
97
108# Toolchain configuration (can be overridden by command line)
119set (CMAKE_C_COMPILER i686-linux -gnu-gcc)
@@ -33,6 +31,11 @@ include_directories(include)
3331file (GLOB_RECURSE ASM_SOURCES "src/*.asm" )
3432file (GLOB_RECURSE C_SOURCES "src/*.c" )
3533
34+ # Force -f elf32 on all assembly files explicitly as well
35+ foreach (asm_file ${ASM_SOURCES} )
36+ set_source_files_properties (${asm_file} PROPERTIES COMPILE_FLAGS "-f elf32" )
37+ endforeach ()
38+
3639# Exclude specific files if needed
3740list (FILTER C_SOURCES EXCLUDE REGEX "src/drivers/vga.c" )
3841
You can’t perform that action at this time.
0 commit comments