Skip to content

Commit

Permalink
added include dirs for improved engine source browsing
Browse files Browse the repository at this point in the history
  • Loading branch information
vorlac committed Oct 5, 2023
1 parent 32abd0c commit 41913fb
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ if(NOT EXISTS "${godot_debug_editor_executable}")
endif()
endif()

# =======================================================================
# Compiler identification
# =======================================================================

# used below to conditionally set certain compile options depending on the toolset used.
# taken from godot-cpp's cmakelists.txt for consistency (along with some of the compiler
# options defined in target_compile_options() below).
set(compiler_is_clang "$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>")
set(compiler_is_gnu "$<CXX_COMPILER_ID:GNU>")
set(compiler_is_msvc "$<CXX_COMPILER_ID:MSVC>")

# =======================================================================
# 3rd party library setup/configuration (leverages vcpkg)
# =======================================================================
Expand Down Expand Up @@ -217,7 +228,12 @@ target_include_directories(godot_engine PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine"
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/platform/windows"
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/zlib"
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/vulkan"
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/vulkan/include"
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/vulkan/include/vulkan"
"${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/drivers/vulkan"
SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/glad"
SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/volk"
SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/zstd"
SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-engine/thirdparty/mbedtls/include"
)
Expand Down Expand Up @@ -248,6 +264,10 @@ target_compile_definitions(godot_engine PUBLIC
VK_USE_PLATFORM_WIN32_KHR
GLAD_ENABLED
GLES_OVER_GL
_SCRT_STARTUP_WINMAIN=1
$<${compiler_is_msvc}:
MSVC
>
)

# =======================================================================
Expand All @@ -266,13 +286,6 @@ file(GLOB_RECURSE roguelite_sources CONFIGURE_DEPENDS
# add the gdextension dynamic library
add_library(${gdextension_lib_name} SHARED ${roguelite_sources})

# used below to conditionally set certain compile options depending on the toolset used.
# taken from godot-cpp's cmakelists.txt for consistency (along with some of the compiler
# options defined in target_compile_options() below).
set(compiler_is_clang "$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>")
set(compiler_is_gnu "$<CXX_COMPILER_ID:GNU>")
set(compiler_is_msvc "$<CXX_COMPILER_ID:MSVC>")

# import the same compiler warning settings that the bindings library uses
include("${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-cpp/cmake/GodotCompilerWarnings.cmake")

Expand Down

0 comments on commit 41913fb

Please sign in to comment.