Skip to content

Commit c55e5cc

Browse files
Александр Першинsmohantty
authored andcommitted
fix msvc 2019 build
1 parent 0ce768f commit c55e5cc

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

CMakeLists.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ target_include_directories(rlottie
4646
"${CMAKE_CURRENT_BINARY_DIR}"
4747
)
4848

49-
#declare target compilation options
49+
#declare common target compilation options
5050
target_compile_options(rlottie
5151
PUBLIC
5252
PRIVATE
@@ -56,14 +56,26 @@ target_compile_options(rlottie
5656
-fno-asynchronous-unwind-tables
5757
-fno-rtti
5858
-Wall
59-
-Werror
60-
-Wextra
61-
-Wnon-virtual-dtor
62-
-Woverloaded-virtual
63-
-Wno-unused-parameter
6459
-fvisibility=hidden
6560
)
6661

62+
#MSVC does not recognize these parameters
63+
if (NOT WIN32)
64+
target_compile_options(rlottie
65+
PUBLIC
66+
PRIVATE
67+
-Werror
68+
-Wextra
69+
-Wnon-virtual-dtor
70+
-Woverloaded-virtual
71+
-Wno-unused-parameter
72+
)
73+
endif()
74+
75+
if (WIN32 AND NOT BUILD_SHARED_LIBS)
76+
target_compile_definitions(rlottie PUBLIC -DLOT_BUILD=0)
77+
endif()
78+
6779
#declare dependancy
6880
set( CMAKE_THREAD_PREFER_PTHREAD TRUE )
6981
find_package( Threads )

0 commit comments

Comments
 (0)