Skip to content

Commit 6836911

Browse files
committed
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).
1 parent 3fba303 commit 6836911

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ include_directories(${SIMPLEINI_DIR})
329329
# Third parties
330330
add_subdirectory(third_party)
331331

332-
# LAF libraries + Aseprite are compiled with config.h
333-
include_directories(src)
334-
add_definitions(-DHAVE_CONFIG_H)
335332
if(ENABLE_MEMLEAK)
336333
add_definitions(-DLAF_MEMLEAK)
337334
endif()
@@ -340,6 +337,11 @@ set(LAF_WITH_TESTS ${ENABLE_TESTS} CACHE BOOL "Enable LAF tests")
340337
set(UNDO_TESTS ${ENABLE_TESTS} CACHE BOOL "Enable undo tests")
341338

342339
add_subdirectory(laf)
340+
341+
# LAF libraries + Aseprite are compiled with config.h
342+
target_include_directories(laf-base PUBLIC src)
343+
target_compile_definitions(laf-base PUBLIC HAVE_CONFIG_H)
344+
343345
add_subdirectory(src)
344346

345347
######################################################################

src/ver/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ endif()
1515

1616
add_library(ver-lib info.c ${gen_ver_fn})
1717
add_dependencies(ver-lib generated_version_h)
18-
target_include_directories(ver-lib PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
18+
target_include_directories(ver-lib PRIVATE .. "${CMAKE_CURRENT_BINARY_DIR}")

0 commit comments

Comments
 (0)