• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2019 Huawei Technologies Co, Ltd.
3#
4
5cmake_minimum_required(VERSION 3.10)
6
7project(LumeAssetCompiler)
8
9option(ASSETCOMPILER_UNIT_TESTS_ENABLED "Build unit tests" OFF)
10
11set(CMAKE_CXX_STANDARD 17)
12set(CMAKE_CXX_STANDARD_REQUIRED ON)
13set(CMAKE_CXX_EXTENSIONS OFF)
14set_property(GLOBAL PROPERTY USE_FOLDERS ON)
15
16set(sources
17    src/app_main.cpp
18    src/app.cpp
19    src/app.h
20    src/dir.cpp
21    src/dir.h
22    src/elf_common.h
23    src/elf32.h
24    src/elf64.h
25    src/coff.h
26    src/maco.h
27    src/platform.cpp
28    src/platform.h
29    src/toarray.h
30)
31source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${sources})
32
33add_executable(LumeAssetCompiler ${sources})
34target_include_directories(LumeAssetCompiler PRIVATE include src)
35target_compile_definitions(LumeAssetCompiler PRIVATE _CRT_SECURE_NO_WARNINGS)
36if(WIN32)
37  target_link_libraries(LumeAssetCompiler wsock32 ws2_32)
38endif()
39if(UNIX AND NOT APPLE)
40#make a static linked executable for linux.
41target_link_libraries(LumeAssetCompiler -static)
42endif()
43
44#
45# Testing project. Not enabled by default.
46#
47if(ASSETCOMPILER_UNIT_TESTS_ENABLED)
48
49	# API Unit tests
50	add_subdirectory(test/api_unit_test)
51	add_test(NAME LumeAssetCompiler COMMAND LumeAssetCompilerTestRunner)
52
53	enable_testing()
54endif()
55