Skip to content

Commit

Permalink
Compatibility with XCode's "new build system"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtalexander committed Oct 9, 2022
1 parent 5ed45e0 commit 2d3e80e
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bindings/guile/CMakeLists.txt
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions common/test-core/CMakeLists.txt
Expand Up @@ -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})
Expand Down
1 change: 1 addition & 0 deletions gnucash/gnome-utils/CMakeLists.txt
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion gnucash/gnome/CMakeLists.txt
Expand Up @@ -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})
Expand Down Expand Up @@ -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)
1 change: 1 addition & 0 deletions gnucash/html/CMakeLists.txt
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gnucash/report/CMakeLists.txt
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libgnucash/app-utils/CMakeLists.txt
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions po/CMakeLists.txt
Expand Up @@ -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()

0 comments on commit 2d3e80e

Please sign in to comment.