Skip to content

Fix CMake paths to support embedding via FetchContent/add_subdirectory - #404

Merged
davidchisnall merged 1 commit into
gnustep:masterfrom
valesnikov:master
Jul 26, 2026
Merged

Fix CMake paths to support embedding via FetchContent/add_subdirectory#404
davidchisnall merged 1 commit into
gnustep:masterfrom
valesnikov:master

Conversation

@valesnikov

Copy link
Copy Markdown
Contributor

Replace CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR with CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR in custom commands that reference source and output files within the libobjc2 project.

This fixes build failures when libobjc2 is used as a subproject via FetchContent or add_subdirectory(), because those variables otherwise point to the parent project's root, causing "no such file" errors for block_trampolines.S, objc_msgSend.S, eh_trampoline.cc, and generated eh_trampoline.S.

Affected files:

  • block_trampolines.obj custom command (Windows)
  • objc_msgSend.obj custom command (Windows)
  • eh_trampoline.S custom command (non-Windows, non-MinGW)

Replace CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR with CMAKE_CURRENT_SOURCE_DIR
and CMAKE_CURRENT_BINARY_DIR in custom commands that reference source and
output files within the libobjc2 project.

This fixes build failures when libobjc2 is used as a subproject via
FetchContent or add_subdirectory(), because those variables otherwise
point to the parent project's root, causing "no such file" errors for
block_trampolines.S, objc_msgSend.S, eh_trampoline.cc, and generated
eh_trampoline.S.

Affected files:
- block_trampolines.obj custom command (Windows)
- objc_msgSend.obj custom command (Windows)
- eh_trampoline.S custom command (non-Windows, non-MinGW)
@davidchisnall
davidchisnall merged commit ea89d21 into gnustep:master Jul 26, 2026
86 of 90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants