-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will compile SDL libraries, dependencies, nene itself and the collisions.c example.
- Loading branch information
Showing
18 changed files
with
119 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2021-present André Luiz Alvares | ||
# Nene is licensed under the Zlib license. | ||
# Please refer to the LICENSE file for details | ||
# SPDX-License-Identifier: Zlib | ||
|
||
# Set minimum cmake version, this should go until the latest available release, | ||
# the first version it's still to be decided though, but it shouldn't be older than the one used by SDL's CMakeLists. | ||
cmake_minimum_required(VERSION 3.15-3.26) | ||
|
||
# Set the project name, version and language | ||
project( | ||
nene | ||
VERSION 0.4 | ||
LANGUAGES C | ||
) | ||
|
||
# set the C standard, be sure to review compile_flags.txt file too. | ||
set(CMAKE_C_STANDARD_REQUIRED 99) | ||
|
||
add_library(${PROJECT_NAME} STATIC) | ||
|
||
# add the src and external directories on the building procedure | ||
add_subdirectory(external) | ||
add_subdirectory(src) | ||
add_subdirectory(examples/c) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2021-present André Luiz Alvares | ||
# Nene is licensed under the Zlib license. | ||
# Please refer to the LICENSE file for details | ||
# SPDX-License-Identifier: Zlib | ||
|
||
add_executable(nene_c_collisions collisions.c) | ||
|
||
target_link_libraries(nene_c_collisions nene) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) 2021-present André Luiz Alvares | ||
# Nene is licensed under the Zlib license. | ||
# Please refer to the LICENSE file for details | ||
# SPDX-License-Identifier: Zlib | ||
|
||
# This cmake file add the "external_libs" library target, with all external modules (that is, SDL libraries) | ||
|
||
# Adds the SDL subdirectories, which are git sub-modules, | ||
# be sure to clone nene with "recurse-submodules" flag, otherwise the SDL | ||
# libraries will not be clonned with nene. | ||
add_subdirectory(SDL) | ||
add_subdirectory(SDL_image) | ||
add_subdirectory(SDL_mixer) | ||
add_subdirectory(SDL_ttf) | ||
|
||
# creating the "external_libs" library target | ||
add_library(external_libs INTERFACE) | ||
|
||
# adding linking to the SDL libraries to the project build. | ||
target_link_libraries(${PROJECT_NAME} INTERFACE SDL2::SDL2) | ||
target_link_libraries(${PROJECT_NAME} INTERFACE SDL2_image::SDL2_image) | ||
target_link_libraries(${PROJECT_NAME} INTERFACE SDL2_mixer::SDL2_mixer) | ||
target_link_libraries(${PROJECT_NAME} INTERFACE SDL2_ttf::SDL2_ttf) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (c) 2021-present André Luiz Alvares | ||
# Nene is licensed under the Zlib license. | ||
# Please refer to the LICENSE file for details | ||
# SPDX-License-Identifier: Zlib | ||
|
||
target_sources(${PROJECT_NAME} PUBLIC | ||
core.c | ||
texture.c | ||
font.c | ||
texture_atlas.c | ||
audio/music.c | ||
audio/sound.c | ||
math/vec2i.c | ||
math/vec2.c | ||
math/rect.c | ||
math/rectf.c | ||
math/grid.c | ||
math/segment.c | ||
math/shape.c | ||
intersections.c | ||
collision.c | ||
animation.c | ||
tilemap.c | ||
color.c | ||
) | ||
|
||
# # add the nene include directory | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/include) | ||
|
||
# # add the sdl include directories (NOTE: remove these once the (game) usage of SDL get's unnecessary) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/external/SDL/include) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/external/SDL_mixer/include) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/external/SDL_image) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/external/SDL_ttf) | ||
|
||
# add linking to the external dependencies (SDL libraries) to the target | ||
target_link_libraries(${PROJECT_NAME} PUBLIC external_libs) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters