Compatibility with XCode's "new build system"

With XCode 14 or newer CMake tries to use the "new build system" which has a
requirement that if two targets depend on the same generated file one of them
must depend on the other.  This commit adds reduntant dependencies to satisfy
this requirement.
This commit is contained in:
Mike Alexander 2022-10-09 00:47:12 -04:00
parent 5ed45e081c
commit 2d3e80ea08
8 changed files with 15 additions and 3 deletions

View File

@ -40,7 +40,9 @@ add_library(gnucash-guile SHARED
${SWIG_ENGINE_C})
add_dependencies(gnucash-guile
swig-runtime-h)
swig-runtime-h
swig-core-utils-guile-c
swig-engine-c)
target_include_directories(gnucash-guile
PUBLIC

View File

@ -42,6 +42,7 @@ gnc_add_swig_python_command (swig-unittest-support-python
add_library(test-core-guile ${SWIG_UNITTEST_SUPPORT_GUILE_C})
target_link_libraries(test-core-guile test-core ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS})
add_dependencies (test-core-guile swig-unittest-support-guile-c )
if (WITH_PYTHON)
add_library(unittest_support MODULE ${SWIG_UNITTEST_SUPPORT_PYTHON_C})

View File

@ -8,6 +8,7 @@ gnc_add_swig_guile_command (swig-gnome-utils-c
${CMAKE_CURRENT_SOURCE_DIR}/gnome-utils.i ""
)
add_dependencies(swig-gnome-utils-c gnc-gnome-utils)
set (WARNINGS_SCHEMA ${DATADIR_BUILD}/glib-2.0/schemas/org.gnucash.GnuCash.warnings.gschema.xml)
set (GNC_WARNINGS_C ${CMAKE_CURRENT_BINARY_DIR}/gnc-warnings.c)
set (GNC_WARNINGS_H ${CMAKE_CURRENT_BINARY_DIR}/gnc-warnings.h)

View File

@ -164,7 +164,7 @@ target_include_directories(gnc-gnome
${CMAKE_BINARY_DIR}/gnucash/gnome-utils # for gnc-warnings.h
)
add_dependencies (gnc-gnome swig-runtime-h)
add_dependencies (gnc-gnome swig-runtime-h swig-gnome-c)
if (MAC_INTEGRATION)
target_compile_options(gnc-gnome PRIVATE ${OSX_EXTRA_COMPILE_FLAGS})
@ -267,3 +267,4 @@ set_dist_list(gnome_DIST
CMakeLists.txt gnome.i gnucash.appdata.xml.in.in gnucash.desktop.in.in
gnucash.releases.xml ${gnc_gnome_noinst_HEADERS} ${gnc_gnome_SOURCES} ${gnome_SCHEME})
dist_add_generated(${BUILDING_FROM_VCS} gnucash.appdata.xml.in)
add_dependencies(gnucash-appdata dist-gnucash-gnome-gnucash-appdata-xml-in)

View File

@ -71,6 +71,7 @@ if (APPLE)
set_target_properties (gnc-html PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
endif()
add_dependencies(gnc-html swig-gnc-html-c)
install(TARGETS gnc-html
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash

View File

@ -23,6 +23,8 @@ add_library (gnc-report
${SWIG_REPORT_C}
)
add_dependencies(gnc-report swig-report-c)
target_compile_definitions(gnc-report PRIVATE -DG_LOG_DOMAIN=\"gnc.report.core\")
target_link_libraries(gnc-report

View File

@ -162,7 +162,7 @@ if (WITH_PYTHON)
endif()
add_dependencies (gnc-app-utils swig-apputils-guile-c )
install(FILES ${app_utils_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnucash)

View File

@ -141,3 +141,7 @@ if(BUILD_GNUCASH_POT)
add_custom_target (pot DEPENDS gnucash.pot)
endif()
dist_add_generated (${BUILDING_FROM_VCS} gnucash.pot)
if(BUILD_GNUCASH_POT)
add_dependencies (dist-po-gnucash-pot pot)
endif()