Skip to content

Commit

Permalink
Configure MSVC Runtime Library
Browse files Browse the repository at this point in the history
  • Loading branch information
dr8co committed Apr 30, 2024
1 parent d70fd59 commit 3d61e75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Options
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(BUILD_EXAMPLES "Build examples" ON)
option(BUILD_TESTING "Build tests" ON)
option(BUILD_TESTING "Build tests" OFF)

# MSVC Runtime Library and other settings
if (MSVC)
if (BUILD_SHARED_LIBS)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
else ()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif ()
endif ()

# Additional compile options for the Debug build
if (NOT MSVC AND CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
Expand Down Expand Up @@ -60,7 +70,8 @@ if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
endif ()
endif ()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Add the CMake module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

add_library(lite-string)
target_sources(lite-string PRIVATE lite_string.c)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Packing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Headers")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION "Header files for LiteString.")
set(CPACK_COMPONENT_HEADERS_REQUIRED ON)

set(CPACK_COMPONENT_DATA_DISPLAY_NAME "Data")
set(CPACK_COMPONENT_DATA_DISPLAY_NAME "Version Info")
set(CPACK_COMPONENT_DATA_DESCRIPTION "Information about this build of LiteString.")

# Resource files
Expand Down

0 comments on commit 3d61e75

Please sign in to comment.