Split CMakeLists.txt for src
This commit is contained in:
parent
7bc21417c5
commit
da22c8d922
|
@ -37,8 +37,6 @@ endif()
|
||||||
|
|
||||||
set(cdroot ${CMAKE_BINARY_DIR}/cdimg)
|
set(cdroot ${CMAKE_BINARY_DIR}/cdimg)
|
||||||
file(MAKE_DIRECTORY ${cdroot})
|
file(MAKE_DIRECTORY ${cdroot})
|
||||||
# Avoid C11 since it is not supported by the i386-mingw32 toolchain.
|
|
||||||
set(cflags -Wall -g3 -ffunction-sections -fdata-sections -pedantic -std=c99)
|
|
||||||
|
|
||||||
if(PS1_BUILD)
|
if(PS1_BUILD)
|
||||||
include("cmake/ps1.cmake")
|
include("cmake/ps1.cmake")
|
||||||
|
@ -49,48 +47,4 @@ elseif(HOST_BUILD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory("res")
|
add_subdirectory("res")
|
||||||
|
add_subdirectory("src")
|
||||||
set(components
|
|
||||||
building
|
|
||||||
camera
|
|
||||||
container
|
|
||||||
font
|
|
||||||
game
|
|
||||||
gfx
|
|
||||||
gui
|
|
||||||
header
|
|
||||||
instance
|
|
||||||
keyboard
|
|
||||||
menu
|
|
||||||
mouse
|
|
||||||
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("src/${c}")
|
|
||||||
target_compile_options(${c} PUBLIC ${cflags})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
foreach(i ${interfaces})
|
|
||||||
add_subdirectory("src/${i}")
|
|
||||||
target_compile_options(${i} INTERFACE ${cflags})
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${c})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
target_link_options(${PROJECT_NAME} PRIVATE -Wl,--gc-sections)
|
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
# 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
|
||||||
|
instance
|
||||||
|
keyboard
|
||||||
|
menu
|
||||||
|
mouse
|
||||||
|
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)
|
Loading…
Reference in New Issue