-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
62 lines (49 loc) · 1.48 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
cmake_minimum_required(VERSION 3.9.4)
project(aoc-language-ini)
set(CMAKE_SYSTEM_NAME Windows)
if (UNIX)
set(CMAKE_RC_COMPILE_OBJECT "i686-w64-mingw32-windres <SOURCE> -O coff -o <OBJECT>")
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
if (NOT MSVC)
add_compile_options(-m32)
add_compile_options(-Wall)
endif()
add_compile_definitions(WINVER=0x0501)
add_compile_definitions(WIN32_LEAN_AND_MEAN)
add_compile_definitions(NOMINMAX)
if(MSVC)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
else()
add_compile_options(-fno-exceptions)
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
add_link_options(-Wl,--exclude-all-symbols)
add_link_options(-s)
endif()
add_link_options(-static-libstdc++ -static-libgcc)
add_compile_options(-Wall -Wsign-compare)
endif()
include_directories(include/)
add_executable(getstrings getstrings.c)
set_source_files_properties(strings.rc PROPERTIES LANGUAGE RC)
set(SOURCE_FILES
aoc_language_ini.c
hook.c
main.c
strings.rc
)
add_library(aoc-language-ini SHARED ${SOURCE_FILES})
if (UNIX)
set_target_properties(aoc-language-ini PROPERTIES
PREFIX ""
SUFFIX ".dll")
endif()
install(TARGETS aoc-language-ini
LIBRARY DESTINATION lib)