forked from Klebert-Engineering/speedyj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (36 loc) · 861 Bytes
/
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
cmake_minimum_required(VERSION 3.14.0)
enable_testing()
if (NOT DEFINED PROJECT_NAME)
project(speedyj)
set(NOT_SUBPROJECT ON)
endif()
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (NOT MSVC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS -fPIC)
endif()
## SpeedyJ
####
add_library(speedyj SHARED
src/speedyj.cpp
include/speedyj/speedyj.hpp
include/speedyj/speedyj-impl.hpp)
target_compile_features(speedyj
PUBLIC
cxx_std_17)
target_include_directories(speedyj
PRIVATE
"src"
PUBLIC
"include")
target_compile_definitions(speedyj
PRIVATE
SPEEDYJ_BUILD=1)
target_compile_options(speedyj
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Werror -fvisibility=hidden>)
add_library(speedyj::speedyj ALIAS speedyj)
if (NOT_SUBPROJECT)
add_subdirectory(test)
endif()