-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
4,384 additions
and
464 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[submodule "imgui"] | ||
path = imgui | ||
path = src/imgui | ||
url = https://github.com/ocornut/imgui | ||
shallow = true |
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,88 @@ | ||
# 3.12 added add_compile_definitions | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
# Build target for CXX project "anura" | ||
project(anura LANGUAGES CXX) | ||
|
||
# Use ccache to accelerate iterating on CXX files, if available | ||
find_program(CCACHE "ccache") | ||
if(CCACHE) | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE}") | ||
endif(CCACHE) | ||
|
||
# Add the source code | ||
file( | ||
GLOB | ||
anura_SRC | ||
"${CMAKE_CURRENT_LIST_DIR}/src/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/hex/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui_draw.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui_tables.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui_widgets.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui_additions/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/kre/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/svg/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/tiled/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/treetree/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/xhtml/*.cpp" | ||
) | ||
|
||
# Configure compiling against system provided libraries | ||
# XXX - At the moment (2023-07) we have no idea of the upper and lower bounds | ||
find_package(Boost REQUIRED) | ||
find_package(Freetype REQUIRED) | ||
find_package(SDL2 REQUIRED) | ||
|
||
# Add the headers | ||
include_directories( | ||
"${CMAKE_CURRENT_LIST_DIR}/src" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/hex" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui_additions" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/kre" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/svg" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/tiled" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/treetree" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/xhtml" | ||
"${Boost_INCLUDE_DIRS}" | ||
"${FREETYPE_INCLUDE_DIRS}" | ||
"${SDL2_INCLUDE_DIRS}" | ||
) | ||
|
||
# Configure compiler flags | ||
|
||
# Good things, to keep | ||
|
||
# -O2 per default | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") | ||
|
||
# Set c++ standard to c++0x | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") | ||
|
||
# Warnings as errors, raise all warnings | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror") | ||
|
||
# Inject our own imgui config for our own vector operations | ||
add_compile_definitions(IMGUI_USER_CONFIG="${CMAKE_CURRENT_LIST_DIR}/src/imgui_additions/imconfig_anura.h") | ||
|
||
# Bad things, to get rid of | ||
|
||
# Use imgui provided vector math | ||
# XXX - imgui_custom.cpp relies on these | ||
add_compile_definitions(IMGUI_DEFINE_MATH_OPERATORS) | ||
|
||
# We need to hide a ton of warnings | ||
include("${CMAKE_CURRENT_LIST_DIR}/cmake-includes/anura/silence-warnings/CMakeLists.txt") | ||
|
||
# Output an executable from the anura sources for anura | ||
add_executable(anura "${anura_SRC}") | ||
|
||
# Configure linking against system provided libraries | ||
target_link_libraries( | ||
anura | ||
LINK_PUBLIC | ||
"${Boost_LIBRARIES}" | ||
"${FREETYPE_LIBRARIES}" | ||
"${SDL2_LIBRARIES}" | ||
) |
Oops, something went wrong.