aboutsummaryrefslogtreecommitdiffstats
path: root/libccnx-transport-rta/CMakeLists.txt
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2017-06-05 15:45:33 +0200
committerMauro Sardara <msardara+fdio@cisco.com>2017-06-05 16:46:09 +0200
commitb9969fb070049f4c9319ab1465481a9709525e6e (patch)
tree12578cb76fc0db9d1fbad5ce64516dadd70a0aad /libccnx-transport-rta/CMakeLists.txt
parent5e7ad51c32a92b84e2e42741d96c68ec834e6f8b (diff)
- Adding support for iOS
- Adding build type: DEBUG, RELEASE, RELEASE with debug symbols, RELEASE with min size executable Change-Id: Idd76bc93af6a90e9e491c53373d845f49b6b3b45 Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
Diffstat (limited to 'libccnx-transport-rta/CMakeLists.txt')
-rw-r--r--libccnx-transport-rta/CMakeLists.txt59
1 files changed, 45 insertions, 14 deletions
diff --git a/libccnx-transport-rta/CMakeLists.txt b/libccnx-transport-rta/CMakeLists.txt
index 6061ee7e..998e0c27 100644
--- a/libccnx-transport-rta/CMakeLists.txt
+++ b/libccnx-transport-rta/CMakeLists.txt
@@ -5,6 +5,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
+if (NOT CMAKE_BUILD_TYPE)
+ message(STATUS "No build type selected, default to Release")
+ set(CMAKE_BUILD_TYPE "Release")
+endif ()
+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if( UNIX )
@@ -21,38 +26,64 @@ if(ANDROID_API)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -Wall")
else()
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG -DCCNxTransport_DISABLE_VALIDATION -DLIBRTA_DISABLE_VALIDATION -DTransportLibrary_DISABLE_VALIDATION")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif()
-#set(CMAKE_C_FLAGS_NOPANTS "${CMAKE_C_FLAGS_NOPANTS} -O3 -DNDEBUG -DCCNxTransport_DISABLE_VALIDATION -DLIBRTA_DISABLE_VALIDATION -DTransportLibrary_DISABLE_VALIDATION")
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DCCNxTransport_DISABLE_VALIDATION -DLIBRTA_DISABLE_VALIDATION -DTransportLibrary_DISABLE_VALIDATION")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${CMAKE_C_FLAGS}")
include_directories(${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/ccnx/transport/transport_rta ${PROJECT_BINARY_DIR}/ccnx)
include_directories($ENV{CCNX_DEPENDENCIES}/include)
set(OPENSSL_ROOT_DIR $ENV{CCNX_DEPENDENCIES})
-find_package( LongBow REQUIRED )
-include_directories(${LONGBOW_INCLUDE_DIRS})
+if(COMPILE_FOR_IOS)
+ find_host_package( LongBow REQUIRED )
+ include_directories(${LONGBOW_INCLUDE_DIRS})
+
+ find_host_package( LibEvent REQUIRED )
+ include_directories(${LIBEVENT_INCLUDE_DIRS})
+
+ find_host_package( Libparc REQUIRED )
+ include_directories(${LIBPARC_INCLUDE_DIRS})
+
+ find_host_package( CCNX_Common REQUIRED )
+ include_directories(${CCNX_COMMON_INCLUDE_DIRS})
+
+ find_host_package ( OpenSSL REQUIRED )
-find_package( LibEvent REQUIRED )
-include_directories(${LIBEVENT_INCLUDE_DIRS})
+ find_host_package( Doxygen )
+else()
+ find_package( LongBow REQUIRED )
+ include_directories(${LONGBOW_INCLUDE_DIRS})
+
+ find_package( LibEvent REQUIRED )
+ include_directories(${LIBEVENT_INCLUDE_DIRS})
-find_package( Libparc REQUIRED )
-include_directories(${LIBPARC_INCLUDE_DIRS})
+ find_package( Libparc REQUIRED )
+ include_directories(${LIBPARC_INCLUDE_DIRS})
-find_package( CCNX_Common REQUIRED )
-include_directories(${CCNX_COMMON_INCLUDE_DIRS})
+ find_package( CCNX_Common REQUIRED )
+ include_directories(${CCNX_COMMON_INCLUDE_DIRS})
-find_package ( Threads REQUIRED )
+ find_package ( Threads REQUIRED )
-find_package ( OpenSSL REQUIRED )
+ find_package ( OpenSSL REQUIRED )
-find_package( Doxygen )
+ find_package( Doxygen )
+
+endif()
if (ANDROID_API)
macro(AddTest testFile)
message("Android build: Skipping test ${ARGV0}")
endmacro(AddTest)
+elseif(COMPILE_FOR_IOS)
+ macro(AddTest testFile)
+ message("iOS build: Skipping test ${ARGV0}")
+ endmacro(AddTest)
else()
macro(AddTest testFile)
add_executable(${ARGV0} ${ARGV0}.c)
@@ -70,7 +101,7 @@ else()
endmacro(AddTest)
endif()
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS)
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup")
message( "-- Set \"-undefined dynamic_lookup\" for shared libraries")
endif()