Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework debug flags for CMake #639

Merged
merged 1 commit into from
Oct 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -44,14 +44,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE Debug)
endif()

if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-D_DEBUG)
add_definitions(-DDEBUG_ENABLED)
add_definitions(-DDEBUG_METHODS_ENABLED)
else()
add_definitions(-DNDEBUG)
endif(CMAKE_BUILD_TYPE MATCHES Debug)

# Set the c++ standard to c++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -155,8 +147,11 @@ add_library(${PROJECT_NAME}
${GENERATED_FILES_LIST}
)
add_library(godot::cpp ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME}
PUBLIC
target_compile_definitions(${PROJECT_NAME} PUBLIC
$<$<CONFIG:Debug>:DEBUG_ENABLED>
$<$<CONFIG:Debug>:DEBUG_METHODS_ENABLED>
)
target_include_directories(${PROJECT_NAME} PUBLIC
include
${CMAKE_CURRENT_BINARY_DIR}/gen/include
)