Skip to content

Commit

Permalink
try to fix win utest linking
Browse files Browse the repository at this point in the history
  • Loading branch information
fm94 committed Jun 2, 2024
1 parent db92af0 commit 6eac736
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
cmake_minimum_required(VERSION 3.0.0)

project(Tipousi VERSION 0.0.1)

# Set the default build type to Debug if not specified
# Set the default build type to Release if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build" FORCE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build" FORCE)
endif()

# Set the runtime library for all targets
if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif()

include_directories(
Expand All @@ -21,10 +28,11 @@ file(GLOB SOURCES "src/*/*.cpp")
include_directories("${CMAKE_SOURCE_DIR}/externals/eigen-3.4.0")

# Add Google Test
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_SOURCE_DIR}/externals/googletest)
enable_testing()

add_library(Tipousi SHARED ${SOURCES})
add_library(Tipousi STATIC ${SOURCES})
# Ensure debug symbols are generated
set_target_properties(Tipousi PROPERTIES COMPILE_FLAGS "-g")

Expand Down

0 comments on commit 6eac736

Please sign in to comment.