Removed old bundle generation
This commit is contained in:
@@ -14,7 +14,6 @@ macro(subdirlist result curdir)
|
|||||||
set(${result} ${dirlist})
|
set(${result} ${dirlist})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
include(Bundles)
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/platform.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/platform.cmake)
|
||||||
platform_config(${PHOTON_TARGET})
|
platform_config(${PHOTON_TARGET})
|
||||||
|
|
||||||
@@ -47,7 +46,7 @@ message(STATUS "CRT files: ${photon_libc_crt}")
|
|||||||
|
|
||||||
add_custom_target(crt ALL
|
add_custom_target(crt ALL
|
||||||
DEPENDS ${photon_libc_crt}
|
DEPENDS ${photon_libc_crt}
|
||||||
COMMAND mx.clang -c -ffreestanding ${photon_libc_crt}
|
COMMAND ${CMAKE_C_COMPILER} -c -ffreestanding ${photon_libc_crt}
|
||||||
COMMENT "Generating CRT files")
|
COMMENT "Generating CRT files")
|
||||||
|
|
||||||
file(GLOB platform_sources
|
file(GLOB platform_sources
|
||||||
@@ -78,50 +77,65 @@ file(GLOB platform_headers
|
|||||||
|
|
||||||
set(photon_libc_sources ${photon_libc_sources} ${malloc_sources} ${platform_sources})
|
set(photon_libc_sources ${photon_libc_sources} ${malloc_sources} ${platform_sources})
|
||||||
set(photon_libc_headers ${photon_libc_headers} ${platform_headers})
|
set(photon_libc_headers ${photon_libc_headers} ${platform_headers})
|
||||||
|
set(photon_libc_include_dirs
|
||||||
add_framework(photon STATIC 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} -ffreestanding -nostdlib)
|
|
||||||
bundle_link_frameworks(photon ${photon_platform_frameworks})
|
|
||||||
|
|
||||||
bundle_include_directories(photon PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/include
|
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/
|
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/sysroot/usr/include)
|
${CMAKE_CURRENT_BINARY_DIR}/sysroot/usr/include)
|
||||||
|
|
||||||
foreach (platform_include_dir ${photon_platform_extra_include_dirs})
|
set(photon_libc_cflags -ffreestanding -nostdlib -fPIC -fPIE)
|
||||||
bundle_include_directories(photon
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/${platform_include_dir})
|
|
||||||
endforeach (platform_include_dir)
|
|
||||||
|
|
||||||
add_custom_target(local-root
|
if (PHOTON_EXPORT_VARS)
|
||||||
DEPENDS ${photon_libc_headers}
|
set(photon_libc_sources ${photon_libc_sources} PARENT_SCOPE)
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/create-sysroot.sh
|
set(photon_libc_headers ${photon_libc_headers} ${platform_headers} PARENT_SCOPE)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
set(photon_libc_crt ${photon_libc_crt} PARENT_SCOPE)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
set(photon_libc_cflags ${photon_libc_cflags} PARENT_SCOPE)
|
||||||
${platform} ${machine})
|
set(photon_libc_include_dirs ${photon_libc_include_dirs} PARENT_SCOPE)
|
||||||
|
return ()
|
||||||
bundle_add_dependencies(photon local-root crt)
|
|
||||||
|
|
||||||
add_custom_command(TARGET photon POST_BUILD
|
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/add-framework-crt.sh
|
|
||||||
${BUNDLE_PROGRAM}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/photon.framework
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
||||||
bundle_link_libraries(photon gcc)
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (TARGET early-sysroot)
|
# add_framework(photon STATIC SHARED
|
||||||
# We are being built as part of asbestOS, make sure the sysroot is there.
|
# BUNDLE_ID net.doorstuck.photon
|
||||||
bundle_add_dependencies(photon early-sysroot)
|
# SOURCES ${photon_libc_sources} ${photon_libc_headers}
|
||||||
endif ()
|
# HEADERS ${CMAKE_CURRENT_BINARY_DIR}/sysroot/usr/include/*)
|
||||||
|
#
|
||||||
if (PHOTON_TESTS EQUAL 1)
|
# bundle_compile_options(photon PRIVATE -ffreestanding -nostdlib -fPIC -fPIE)
|
||||||
add_subdirectory(tests)
|
# bundle_link_libraries(photon ${photon_platform_libs} -ffreestanding -nostdlib)
|
||||||
endif ()
|
# bundle_link_frameworks(photon ${photon_platform_frameworks})
|
||||||
|
#
|
||||||
|
# bundle_include_directories(photon PRIVATE
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/include
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/
|
||||||
|
# ${CMAKE_CURRENT_BINARY_DIR}/sysroot/usr/include)
|
||||||
|
#
|
||||||
|
# foreach (platform_include_dir ${photon_platform_extra_include_dirs})
|
||||||
|
# bundle_include_directories(photon
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}/photon/libc/sys/${platform}/${platform_include_dir})
|
||||||
|
# endforeach (platform_include_dir)
|
||||||
|
#
|
||||||
|
# add_custom_target(local-root
|
||||||
|
# DEPENDS ${photon_libc_headers}
|
||||||
|
# COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/create-sysroot.sh
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
# ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
# ${platform} ${machine})
|
||||||
|
#
|
||||||
|
# bundle_add_dependencies(photon local-root crt)
|
||||||
|
#
|
||||||
|
# add_custom_command(TARGET photon POST_BUILD
|
||||||
|
# COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/add-framework-crt.sh
|
||||||
|
# ${BUNDLE_PROGRAM}
|
||||||
|
# ${CMAKE_CURRENT_BINARY_DIR}/photon.framework
|
||||||
|
# ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
#
|
||||||
|
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
# bundle_link_libraries(photon gcc)
|
||||||
|
# endif ()
|
||||||
|
#
|
||||||
|
# if (TARGET early-sysroot)
|
||||||
|
# # We are being built as part of asbestOS, make sure the sysroot is there.
|
||||||
|
# bundle_add_dependencies(photon early-sysroot)
|
||||||
|
# endif ()
|
||||||
|
#
|
||||||
|
# if (PHOTON_TESTS EQUAL 1)
|
||||||
|
# add_subdirectory(tests)
|
||||||
|
# endif ()
|
||||||
|
|||||||
Reference in New Issue
Block a user