rts/src/CMakeLists.txt

50 lines
935 B
CMake

# Avoid C11 since it is not supported by the i386-mingw32 toolchain.
set(cflags -Wall -g3 -ffunction-sections -fdata-sections -pedantic -std=c99)
set(components
building
camera
container
font
game
gfx
gui
header
input
instance
keyboard
menu
mouse
net
pad
peripheral
player
resource
sfx
system
terrain
unit
util
)
set(interfaces
tech
)
target_compile_options(${PROJECT_NAME} PUBLIC ${cflags})
# Dependencies for main.c
target_link_libraries(${PROJECT_NAME} PRIVATE system menu)
foreach(c ${components})
add_subdirectory("${c}")
target_compile_options(${c} PUBLIC ${cflags})
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)