-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathCMakeLists.txt
53 lines (40 loc) · 1.2 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
cmake_minimum_required(VERSION 3.11)
project(LuaCodeStyle)
set(CMAKE_CXX_STANDARD 20)
option(BuildAsLuaLib "Build for lua dll" OFF)
option(BuildCodeFormat "Build CodeFormat" ON)
option(BuildCodeFormatServer "Build CodeFormatServer" ON)
option(BuildCodeFormatCLib "Build CodeFormatCLib" ON)
option(EnableTest "Test project" ON)
if(APPLE)
include(CheckCCompilerFlag)
set(CMAKE_REQUIRED_LINK_OPTIONS "-arch;x86_64")
check_c_compiler_flag("-arch x86_64" x86_64Supported)
message("x86_64Supported=${x86_64Supported}")
set(CMAKE_REQUIRED_LINK_OPTIONS "-arch;arm64")
check_c_compiler_flag("-arch arm64" arm64Supported)
message("arm64Supported=${arm64Supported}")
endif ()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(LuaParser)
add_subdirectory(CodeFormatCore)
add_subdirectory(Util)
if(BuildAsLuaLib)
add_subdirectory(CodeFormatLib)
endif()
if(BuildCodeFormat)
add_subdirectory(CodeFormat)
endif()
if(BuildCodeFormatServer)
add_subdirectory(CodeFormatServer)
endif()
if(BuildCodeFormatCLib)
add_subdirectory(CodeFormatCLib)
endif()
if(EnableTest)
enable_testing()
add_subdirectory(3rd/googletest-1.13.0)
add_subdirectory(Test)
# for feature develop simple test
add_subdirectory(Test2)
endif()