Skip to content

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

Open
valesnikov wants to merge 1 commit into
gnustep:masterfrom
valesnikov:master
Open

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

Conversation

@valesnikov

Copy link
Copy Markdown

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)
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.

1 participant