Don't define HAVE_CONFIG_H and include "src" directory globally

Avoid using include_directories() and add_definitions() as much as
possible.

This change was made to avoid a problem using HAVE_CONFIG_H on Sentry
breakpad implementation where HAVE_CONFIG_H is used (but our config.h
is different from the expected one in breakpad).
This commit is contained in:
David Capello 2021-12-22 19:08:43 -03:00
parent 3fba303291
commit 6836911661
2 changed files with 6 additions and 4 deletions

View File

@ -329,9 +329,6 @@ include_directories(${SIMPLEINI_DIR})
# Third parties # Third parties
add_subdirectory(third_party) add_subdirectory(third_party)
# LAF libraries + Aseprite are compiled with config.h
include_directories(src)
add_definitions(-DHAVE_CONFIG_H)
if(ENABLE_MEMLEAK) if(ENABLE_MEMLEAK)
add_definitions(-DLAF_MEMLEAK) add_definitions(-DLAF_MEMLEAK)
endif() endif()
@ -340,6 +337,11 @@ set(LAF_WITH_TESTS ${ENABLE_TESTS} CACHE BOOL "Enable LAF tests")
set(UNDO_TESTS ${ENABLE_TESTS} CACHE BOOL "Enable undo tests") set(UNDO_TESTS ${ENABLE_TESTS} CACHE BOOL "Enable undo tests")
add_subdirectory(laf) add_subdirectory(laf)
# LAF libraries + Aseprite are compiled with config.h
target_include_directories(laf-base PUBLIC src)
target_compile_definitions(laf-base PUBLIC HAVE_CONFIG_H)
add_subdirectory(src) add_subdirectory(src)
###################################################################### ######################################################################

View File

@ -15,4 +15,4 @@ endif()
add_library(ver-lib info.c ${gen_ver_fn}) add_library(ver-lib info.c ${gen_ver_fn})
add_dependencies(ver-lib generated_version_h) add_dependencies(ver-lib generated_version_h)
target_include_directories(ver-lib PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") target_include_directories(ver-lib PRIVATE .. "${CMAKE_CURRENT_BINARY_DIR}")