cmake: fix CONFIG_HAVE_CXXINITIALIZE on macOS

Note: This implementation is a bit more relaxed than what we do for
non-cmake builds. Mainly because I'm not familiar enough with cmake
to mirror what the non-cmake version does.
This commit is contained in:
YAMAMOTO Takashi
2024-01-04 18:21:21 +09:00
committed by Xiang Xiao
parent 32ea2914c0
commit d0335f089f
+9
View File
@@ -140,6 +140,15 @@ list(
sim_hosttime.c
sim_hostuart.c)
# Note: sim_macho_init.c is picky about the place in the object list for
# linking. Namely, its constructor should be the first one in the executable.
# For now, we are just assuming no other files in HOSTSRCS provide constructors.
if(CONFIG_HOST_MACOS)
if(CONFIG_HAVE_CXXINITIALIZE)
list(APPEND HOSTSRCS sim_macho_init.c)
endif()
endif()
if(CONFIG_SIM_CAMERA_V4L2)
list(APPEND HOSTSRCS sim_host_v4l2.c)
list(APPEND SRCS sim_camera.c)