Skip to content

Commit 395c084

Browse files
committed
Enable BUILD_CORE_DLL
1 parent 5b70f39 commit 395c084

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

cmake/compileroptions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function(target_dll_compile_definitions TARGET)
3636
endif()
3737

3838

39-
if (BUILD_SHARED_LIBS AND MSVC)
39+
if ((BUILD_SHARED_LIBS OR BUILD_CORE_DLL) AND MSVC)
4040
if(PARSE_EXPORT)
4141
target_compile_definitions(${TARGET} PRIVATE ${PARSE_EXPORT})
4242
endif()

cmake/options.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ else()
5353
endif()
5454

5555
option(BUILD_CORE_DLL "Build lib as cppcheck-core.dll with Visual Studio" OFF)
56-
if(BUILD_CORE_DLL AND NOT MSVC)
57-
message(FATAL_ERROR "Building of lib as DLL is only supported with Visual Studio")
58-
endif()
5956
option(BUILD_TESTS "Build tests" OFF)
6057
option(REGISTER_TESTS "Register tests in CTest" ON)
6158
option(ENABLE_CHECK_INTERNAL "Enable internal checks" OFF)

lib/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if(BUILD_CORE_DLL)
2+
set(BUILD_SHARED_LIBS On)
3+
endif()
4+
15
file(GLOB_RECURSE hdrs "*.h")
26
file(GLOB_RECURSE srcs "*.cpp")
37

0 commit comments

Comments
 (0)