Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/compileroptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function(target_dll_compile_definitions TARGET)
endif()


if (BUILD_SHARED_LIBS AND MSVC)
if ((BUILD_SHARED_LIBS OR BUILD_CORE_DLL) AND MSVC)
if(PARSE_EXPORT)
target_compile_definitions(${TARGET} PRIVATE ${PARSE_EXPORT})
endif()
Expand Down
3 changes: 0 additions & 3 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ else()
endif()

option(BUILD_CORE_DLL "Build lib as cppcheck-core.dll with Visual Studio" OFF)
if(BUILD_CORE_DLL AND NOT MSVC)
message(FATAL_ERROR "Building of lib as DLL is only supported with Visual Studio")
endif()
option(BUILD_TESTS "Build tests" OFF)
option(REGISTER_TESTS "Register tests in CTest" ON)
option(ENABLE_CHECK_INTERNAL "Enable internal checks" OFF)
Expand Down
10 changes: 10 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if(BUILD_CORE_DLL)
set(BUILD_SHARED_LIBS On)
endif()

file(GLOB_RECURSE hdrs "*.h")
file(GLOB_RECURSE srcs "*.cpp")

Expand Down Expand Up @@ -62,3 +66,9 @@ endif()
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
target_precompile_headers(cppcheck-core PRIVATE precompiled.h)
endif()

if(BUILD_CORE_DLL)
install(TARGETS cppcheck-core
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
COMPONENT applications)
endif()
Loading