-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
29 lines (21 loc) · 771 Bytes
/
CMakeLists.txt
File metadata and controls
29 lines (21 loc) · 771 Bytes
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
cmake_minimum_required(VERSION 3.20.2)
# Set the project name
project(AOLibrary VERSION 1.0)
# Specify the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set compiler flags
if (MSVC)
add_compile_options(-W4)
elseif(MINGW OR MSYS)
# Prevent CMake to append `lib` to the output filename
set(CMAKE_SHARED_LIBRARY_PREFIX "")
add_compile_options(-Wall -m32)
add_link_options(-Wl,--kill-at)
endif()
# Get a list of all *.cpp and files to pass to the compiler
file(GLOB SOURCE_CODE CONFIGURE_DEPENDS "src/*.cpp")
# Declare library and sources
add_library(${PROJECT_NAME} SHARED ${SOURCE_CODE})
# Include header files from `include` directory
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/src/include")