Skip to content
Open
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
21 changes: 15 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (NE10_BUILD_UNIT_TEST)
#should build the releave version, see the BUILD_DEBUG below.
option(NE10_SMOKE_TEST "Run smoke test" OFF)
option(NE10_REGRESSION_TEST "Run regression test" OFF)
option(NE10_PERFORMANCE_TEST "Run performance test" OFF)
option(NE10_PERFORMANCE_TEST "Run performance test" ON)

option(NE10_DEBUG_TRACE "Print debug trace" OFF)
endif()
Expand All @@ -67,26 +67,35 @@ endif()
if(DEFINED NE10_LINUX_TARGET_ARCH)
if(${NE10_LINUX_TARGET_ARCH} STREQUAL "armv7")
set(NE10_TARGET_ARCH "armv7")
else()
elsif(${NE10_LINUX_TARGET_ARCH} STREQUAL "aarch64")
set(NE10_TARGET_ARCH "aarch64")
else()
# Catch all. Will only build plain C variant of library, with no intrinsics
set(NE10_TARGET_ARCH "other")
endif()
endif()

if(DEFINED NE10_IOS_TARGET_ARCH)
if(${NE10_IOS_TARGET_ARCH} STREQUAL "armv7")
set(NE10_TARGET_ARCH "armv7")
else()
elsif(${NE10_LINUX_TARGET_ARCH} STREQUAL "aarch64")
set(NE10_TARGET_ARCH "aarch64")
else()
# Catch all. Will only build plain C variant of library, with no intrinsics
set(NE10_TARGET_ARCH "other")
endif()
endif()

message("-- Target architecture: ${NE10_TARGET_ARCH}")
if(NOT DEFINED NE10_IOS_TARGET_ARCH AND NOT DEFINED NE10_LINUX_TARGET_ARCH AND NOT DEFINED NE10_ANDROID_TARGET_ARCH)
set(NE10_TARGET_ARCH "other")
endif()
message("-- Target architecture:" ${NE10_TARGET_ARCH})

#select functionalities to be compiled
if("${NE10_TARGET_ARCH}" STREQUAL "armv7")
# Math module has not been optimized for aarch64.
# Math module has only been optimized for armv7
option(NE10_ENABLE_MATH "Build math functionalities to NE10" ON)
# Physics module has not been optimized for aarch64.
# Physics module has only been optimized for armv7
option(NE10_ENABLE_PHYSICS "Build physics functionalities to NE10" ON)
endif()
option(NE10_ENABLE_DSP "Build dsp functionalities to NE10" ON)
Expand Down
49 changes: 37 additions & 12 deletions modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,17 @@ include_directories (
)

if(NE10_BUILD_STATIC OR ANDROID_PLATFORM OR IOS_DEMO)
add_library( NE10 STATIC
${NE10_C_SRCS}
${NE10_INTRINSIC_SRCS}
${NE10_NEON_SRCS}
${NE10_INIT_SRCS}
)

if("${NE10_TARGET_ARCH}" STREQUAL "other")
add_library( NE10 STATIC ${NE10_C_SRCS} )
else()
add_library( NE10 STATIC
${NE10_C_SRCS}
${NE10_INTRINSIC_SRCS}
${NE10_NEON_SRCS}
${NE10_INIT_SRCS}
)
endif()
set_target_properties(NE10 PROPERTIES
CLEAN_DIRECT_OUTPUT 1
VERSION ${NE10_VERSION}
Expand All @@ -383,6 +388,14 @@ if(NE10_BUILD_STATIC OR ANDROID_PLATFORM OR IOS_DEMO)
LINKER_LANGUAGE C
)

# If the CMake version supports it, attach header directory information
# to the targets for when we are part of a parent build (ie being pulled
# in via add_subdirectory() rather than being a standalone build).
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
target_include_directories(NE10 INTERFACE "${PROJECT_SOURCE_DIR}/inc")
target_include_directories(NE10 INTERFACE "${PROJECT_SOURCE_DIR}/common")
endif()

if(IOS_DEMO)
install(TARGETS NE10
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../ios/NE10Demo/libs/)
Expand All @@ -391,12 +404,16 @@ endif()

if(NE10_BUILD_SHARED)

add_library( NE10_shared SHARED
${NE10_C_SRCS}
${NE10_INTRINSIC_SRCS}
${NE10_NEON_SRCS}
${NE10_INIT_SRCS}
)
if("${NE10_TARGET_ARCH}" STREQUAL "other")
add_library( NE10_shared SHARED ${NE10_C_SRCS} )
else()
add_library( NE10_shared SHARED
${NE10_C_SRCS}
${NE10_INTRINSIC_SRCS}
${NE10_NEON_SRCS}
${NE10_INIT_SRCS}
)
endif()

target_link_libraries(NE10_shared m)

Expand All @@ -422,4 +439,12 @@ if(NE10_BUILD_SHARED)

target_link_libraries(NE10_test m)

# If the CMake version supports it, attach header directory information
# to the targets for when we are part of a parent build (ie being pulled
# in via add_subdirectory() rather than being a standalone build).
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
target_include_directories(NE10_shared INTERFACE "${PROJECT_SOURCE_DIR}/inc")
target_include_directories(NE10_shared INTERFACE "${PROJECT_SOURCE_DIR}/common")
endif()

endif()