Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Cross-Compilation for iOS #512

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
Expand Down Expand Up @@ -243,6 +243,10 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQ
SET(EMBREE_ARM ON)
ENDIF()

IF (APPLE)
option(EMBREE_BUILD_APPLE_FRAMEWORKS "Build as Apple Frameworks" OFF)
ENDIF()

SET(EMBREE_TASKING_SYSTEM "TBB" CACHE STRING "Selects tasking system")
SET(EMBREE_TBB_COMPONENT "tbb" CACHE STRING "The TBB component/library name.")

Expand Down
17 changes: 14 additions & 3 deletions common/lexers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

ADD_LIBRARY(lexers STATIC
Expand All @@ -10,8 +10,19 @@ SET_PROPERTY(TARGET lexers PROPERTY FOLDER common)
SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")

IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS lexers EXPORT lexers-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(TARGETS lexers
EXPORT lexers-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL)
INSTALL(EXPORT lexers-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()


IF (EMBREE_BUILD_APPLE_FRAMEWORKS)
set_target_properties(lexers PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.intel.embree.lexers
MACOSX_FRAMEWORK_IDENTIFIER com.intel.embree.lexers
MACOSX_FRAMEWORK_BUNDLE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${EMBREE_VERSION_MAJOR})
ENDIF()
16 changes: 14 additions & 2 deletions common/math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

ADD_LIBRARY(math STATIC constants.cpp)
SET_PROPERTY(TARGET math PROPERTY FOLDER common)
SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")

IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS math EXPORT math-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(TARGETS math
EXPORT math-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL)
INSTALL(EXPORT math-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()

IF (EMBREE_BUILD_APPLE_FRAMEWORKS)
set_target_properties(math PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.intel.embree.math
MACOSX_FRAMEWORK_IDENTIFIER com.intel.embree.math
MACOSX_FRAMEWORK_BUNDLE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${EMBREE_VERSION_MAJOR})
ENDIF()
16 changes: 14 additions & 2 deletions common/simd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

ADD_LIBRARY(simd STATIC sse.cpp)
SET_PROPERTY(TARGET simd PROPERTY FOLDER common)
SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")

IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS simd EXPORT simd-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(TARGETS simd
EXPORT simd-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL)
INSTALL(EXPORT simd-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()

IF (EMBREE_BUILD_APPLE_FRAMEWORKS)
set_target_properties(simd PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.intel.embree.simd
MACOSX_FRAMEWORK_IDENTIFIER com.intel.embree.simd
MACOSX_FRAMEWORK_BUNDLE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${EMBREE_VERSION_MAJOR})
ENDIF()
16 changes: 14 additions & 2 deletions common/sys/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

SET(CMAKE_THREAD_PREFER_PTHREAD TRUE)
Expand Down Expand Up @@ -26,7 +26,19 @@ IF (EMBREE_SYCL_SUPPORT)
ENDIF()

IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS sys EXPORT sys-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(TARGETS sys
EXPORT sys-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL)
INSTALL(EXPORT sys-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()

IF (EMBREE_BUILD_APPLE_FRAMEWORKS)
set_target_properties(sys PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.intel.embree.sys
MACOSX_FRAMEWORK_IDENTIFIER com.intel.embree.sys
MACOSX_FRAMEWORK_BUNDLE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${EMBREE_VERSION_MAJOR})
ENDIF()
17 changes: 15 additions & 2 deletions common/tasking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

IF (TASKING_INTERNAL)
Expand Down Expand Up @@ -73,6 +73,19 @@ SET_PROPERTY(TARGET tasking PROPERTY FOLDER common)
SET_PROPERTY(TARGET tasking APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")

IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS tasking EXPORT tasking-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(TARGETS tasking
EXPORT tasking-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL)
INSTALL(EXPORT tasking-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()

IF (EMBREE_BUILD_APPLE_FRAMEWORKS)
set_target_properties(tasking PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.intel.embree.tasking
MACOSX_FRAMEWORK_IDENTIFIER com.intel.embree.tasking
MACOSX_FRAMEWORK_BUNDLE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${EMBREE_VERSION_MAJOR})
ENDIF()
22 changes: 19 additions & 3 deletions kernels/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

IF (EMBREE_SYCL_RT_SIMULATION)
Expand Down Expand Up @@ -89,7 +89,7 @@ SET(EMBREE_LIBRARY_FILES
bvh/bvh_builder_sah_mb.cpp
bvh/bvh_builder_twolevel.cpp
bvh/bvh_intersector1_bvh4.cpp
)
)


IF (EMBREE_SYCL_SUPPORT)
Expand Down Expand Up @@ -266,7 +266,10 @@ IF (EMBREE_SYCL_SUPPORT)
TARGET_LINK_LIBRARIES(embree_sycl PRIVATE rtcore)
ENDIF()

INSTALL(TARGETS embree_sycl EXPORT embree_sycl-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
INSTALL(TARGETS embree_sycl
EXPORT embree_sycl-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime OPTIONAL)
INSTALL(EXPORT embree_sycl-targets DESTINATION ${EMBREE_CMAKEEXPORT_DIR} COMPONENT devel)

SET_TARGET_PROPERTIES(embree_sycl PROPERTIES OUTPUT_NAME embree${EMBREE_VERSION_MAJOR}_sycl)
Expand Down Expand Up @@ -382,12 +385,25 @@ ELSE()
SET_TARGET_PROPERTIES(embree PROPERTIES VERSION ${EMBREE_VERSION} SOVERSION ${EMBREE_VERSION_MAJOR})
ENDIF()

# Apple frameworks
IF (EMBREE_BUILD_APPLE_FRAMEWORKS)
set_target_properties(embree PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.intel.embree
MACOSX_FRAMEWORK_IDENTIFIER com.intel.embree
MACOSX_FRAMEWORK_BUNDLE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${EMBREE_VERSION_MAJOR})
ENDIF()

INSTALL(TARGETS embree EXPORT embree-targets
LIBRARY NAMELINK_SKIP DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib
# on Windows put the dlls into bin
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT examples
# ... and the import lib into the devel package
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
# Optional Apple frameworks
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL
)

# export Embree targets
Expand Down
6 changes: 4 additions & 2 deletions kernels/level_zero/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

SET(EMBREE_ZE_LOADER_RUNTIME_LINK_NAME_LINUX "libze_loader.so.1" CACHE STRING "Name of the ze_loader lib that is looked for at runtime on Linux")
Expand All @@ -23,6 +23,8 @@ SET_PROPERTY(TARGET ze_wrapper PROPERTY FOLDER common)
SET_PROPERTY(TARGET ze_wrapper APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")

IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS ze_wrapper EXPORT ze_wrapper-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(TARGETS ze_wrapper
EXPORT ze_wrapper-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL)
INSTALL(EXPORT ze_wrapper-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()
7 changes: 5 additions & 2 deletions kernels/rthwif/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009-2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.5)
Expand Down Expand Up @@ -151,7 +151,10 @@ IF (EMBREE_SYCL_RT_VALIDATION_API)
SET_PROPERTY(TARGET embree_rthwif_sycl APPEND PROPERTY COMPILE_FLAGS "-DEMBREE_SYCL_SUPPORT")
SET_TARGET_PROPERTIES(embree_rthwif_sycl PROPERTIES COMPILE_FLAGS ${CMAKE_CXX_FLAGS_SYCL})

INSTALL(TARGETS embree_rthwif_sycl EXPORT embree_rthwif_sycl-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
INSTALL(TARGETS embree_rthwif_sycl
EXPORT embree_rthwif_sycl-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime OPTIONAL)
INSTALL(EXPORT embree_rthwif_sycl-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)

SET(EMBREE_RTHWIF_SYCL embree_rthwif_sycl)
Expand Down