From 6836911661ba0fd069fdca00785948e348e1c6a7 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 22 Dec 2021 19:08:43 -0300 Subject: [PATCH] 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). --- CMakeLists.txt | 8 +++++--- src/ver/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b359964a..968c429fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -329,9 +329,6 @@ include_directories(${SIMPLEINI_DIR}) # Third parties add_subdirectory(third_party) -# LAF libraries + Aseprite are compiled with config.h -include_directories(src) -add_definitions(-DHAVE_CONFIG_H) if(ENABLE_MEMLEAK) add_definitions(-DLAF_MEMLEAK) 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") 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) ###################################################################### diff --git a/src/ver/CMakeLists.txt b/src/ver/CMakeLists.txt index 238b3cfd4..bb5b32c65 100644 --- a/src/ver/CMakeLists.txt +++ b/src/ver/CMakeLists.txt @@ -15,4 +15,4 @@ endif() add_library(ver-lib info.c ${gen_ver_fn}) 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}")