-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (59 loc) · 2.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required(VERSION 3.0.0)
message("Begin LibRPM build")
message("Target platform: " ${RPM_PLATFORM})
IF (RPM_PLATFORM STREQUAL "ARMv5T")
message("Building for ARMv5T")
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_FLAGS "--specs=nosys.specs")
set(CMAKE_CXX_FLAGS "--specs=nosys.specs")
set(CMAKE_EXE_LINKER_FLAGS "-r -march=armv5t -mthumb" CACHE INTERNAL "")
add_compile_options(-march=armv5t -mthumb)
add_compile_definitions(EXL_PLATFORM_GFL)
ELSEIF (RPM_PLATFORM STREQUAL "Win32")
message("Building for Win32")
ELSE ()
message( FATAL_ERROR "Invalid target platform!")
ENDIF ()
project(LibRPM VERSION 0.13.0)
add_compile_options(-fno-rtti -fno-exceptions -fvisibility=hidden)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../extlib)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(DEBUG)
endif()
if (EXL_DESMUME)
add_compile_definitions(EXL_DESMUME)
endif()
file(GLOB DLL_SOURCES
src/*.cpp
include/*.h
../extlib/Util/exl_Print.*
)
add_library(LibRPM OBJECT ${DLL_SOURCES})
set_target_properties(LibRPM PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(LibRPM PUBLIC include)
add_library(LibRPM.Include OBJECT include/RPM_Api.h)
set_target_properties(LibRPM.Include PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(LibRPM.Include PUBLIC include)
IF (WIN32)
add_compile_definitions(EXL_PLATFORM_WIN32)
file(GLOB TESTS_SOURCES
RPM_Tests.cpp
../extlib/ABI/*
../extlib/Heap/exl_HeapArea.*
../extlib/Heap/exl_MemOperators.*
../extlib/Heap/exl_Allocator.*
)
add_executable(RPMTests ${TESTS_SOURCES})
target_link_libraries(RPMTests LibRPM)
add_library(LibRPM.Static include/RPM_Api.h)
target_link_libraries(LibRPM.Static LibRPM)
ELSE ()
add_executable(LibRPM.DLL include/RPM_Api.h)
add_library(LibRPM.Static include/RPM_Api.h)
target_link_libraries(LibRPM.DLL LibRPM)
target_link_libraries(LibRPM.Static LibRPM)
ENDIF ()
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)