Framework is now dynamically linked

This commit is contained in:
Max Wash
2020-11-05 21:23:34 +00:00
parent 635059acc3
commit f7df90bc0f
4 changed files with 32 additions and 16 deletions

View File

@@ -43,9 +43,12 @@ file(GLOB_RECURSE photon_libc_headers ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/in
file(GLOB photon_libc_crt
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/machine/${machine}/crt*.s)
message(STATUS "CRT files: ${photon_libc_crt}")
add_library(crt OBJECT ${photon_libc_crt})
target_compile_options(crt PRIVATE -c -ffreestanding -nostdlib)
add_custom_target(crt ALL
DEPENDS ${photon_libc_crt}
COMMAND mx.clang -c -ffreestanding ${photon_libc_crt}
COMMENT "Generating CRT files")
file(GLOB platform_sources
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/*.c
@@ -76,13 +79,13 @@ file(GLOB platform_headers
set(photon_libc_sources ${photon_libc_sources} ${malloc_sources} ${platform_sources})
set(photon_libc_headers ${photon_libc_headers} ${platform_headers})
add_framework(photon STATIC
add_framework(photon SHARED
BUNDLE_ID net.doorstuck.photon
SOURCES ${photon_libc_sources} ${photon_libc_headers}
HEADERS ${CMAKE_CURRENT_BINARY_DIR}/sysroot/usr/include/*)
bundle_compile_options(photon PRIVATE -ffreestanding -nostdlib -fPIC -fPIE)
bundle_link_libraries(photon ${photon_platform_libs})
bundle_link_libraries(photon ${photon_platform_libs} -ffreestanding)
bundle_link_frameworks(photon ${photon_platform_frameworks})
bundle_include_directories(photon PRIVATE