elf.c: section limit inference for linux, fixes for stb_ds.h hashing, more compilation flags

This commit is contained in:
2024-07-28 01:44:39 +03:00
parent 36dcf14db7
commit 5ddf0eb879
9 changed files with 137 additions and 33 deletions

View File

@ -23,6 +23,14 @@ add_subdirectory(third-party/physfs)
add_subdirectory(third-party/libxm)
if(UNIX)
set(SYSTEM_SOURCE_FILES
src/system/linux/elf.c
)
else()
set(SYSTEM_SOURCE_FILES)
endif()
set(SOURCE_FILES
third-party/physfs/extras/physfsrwops.c
third-party/stb/stb_vorbis.c
@ -49,6 +57,8 @@ set(SOURCE_FILES
src/game/scenes/scene.c src/game/scenes/scene.h
src/game/scenes/title.c src/game/scenes/title.h
src/game/scenes/ingame.c src/game/scenes/ingame.h
${SYSTEM_SOURCE_FILES}
)
# target
@ -90,19 +100,24 @@ else()
# these SHOULDN'T break anything...
-fno-math-errno
-ffp-contract=fast
-fno-signed-zeros
-fno-trapping-math
-freciprocal-math)
-fno-signed-zeros)
set(BUILD_FLAGS_RELEASE
-O3
-flto
-Wl,-gc-sections
-fdata-sections
-ffunction-sections)
-ffunction-sections
-funroll-loops
-fomit-frame-pointer
-fallow-store-data-races)
set(BUILD_FLAGS_DEBUG
-O0
-g3
-gdwarf
-fno-omit-frame-pointer
-fstack-protector-all
-fsanitize=undefined
-fsanitize-trap=undefined)
-fsanitize=address)
target_compile_options(${PROJECT_NAME} PRIVATE
${WARNING_FLAGS}
${BUILD_FLAGS}