-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
55 lines (45 loc) · 1.14 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
cmake_minimum_required ( VERSION 3.10 FATAL_ERROR )
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
find_package(Dotnet 2.0 REQUIRED)
project(AsmTool NONE)
if(WIN32)
set(REKO_COMPILER "Visual Studio 17 2022")
endif()
set(target_platform "")
if(WIN32)
# required for asmdll interop
set(target_platform PLATFORM x86)
endif()
ADD_DOTNET(${CMAKE_SOURCE_DIR}/AsmTool.sln
${target_platform}
CONFIG ${CMAKE_BUILD_TYPE}
TARGET_NAME AsmTool_sln
)
if(UNIX)
enable_language(C)
add_subdirectory(AsmTool/Linux)
add_dependencies(AsmTool_sln asmIoLinux)
endif()
include(FindSevenZip)
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE head_sha
)
string(SUBSTRING "${head_sha}" 0 10 build_shorthash)
set(file_list "")
list(APPEND file_list
${CMAKE_BINARY_DIR}/AsmTool/net6.0/*
)
if(UNIX)
list(APPEND file_list $<TARGET_FILE:asmIoLinux>)
endif()
add_custom_target(create_zip
COMMENT "Compressing..."
COMMAND ${SEVENZIP_BIN} a
${CMAKE_BINARY_DIR}/AsmTool-${build_shorthash}.zip
${file_list}
)
add_dependencies(create_zip AsmTool_sln)
add_custom_target(main ALL)
add_dependencies(main create_zip)