Commit 5d4ebe77 authored by Wei Pan's avatar Wei Pan Committed by gbsbuild

Use an option to control /MT or /MD

Change-Id: I157c75b583028d3f737123bce103aebf2b345c1e
parent 49497e5d
......@@ -34,6 +34,10 @@ set(LINK_DLL_IGA 1)
endif(IGC_BUILD)
# Set up build flags to use dynamic multi-threaded runtime (/MD) or
# to use static multi-threaded runtime (/MT)
option(LINK_AS_STATIC_LIB "link with /MT or /MD" ON)
################################################################################
# IGA Related
......@@ -125,10 +129,6 @@ BISON_TARGET(CISAParser CISA.y ${CMAKE_CURRENT_BINARY_DIR}/CISA.tab.c COMPILE_FL
FLEX_TARGET(CISAScanner CISA.l ${CMAKE_CURRENT_BINARY_DIR}/lex.CISA.c COMPILE_FLAGS "-PCISA ${WIN_FLEX_FLAG}")
ADD_FLEX_BISON_DEPENDENCY(CISAScanner CISAParser)
# Set up windows mobile build flags to use dynamic multi-threaded runtime (/MD)
# Set up windows(other) build flags to use static multi-threaded runtime (/MT)
# Set up include paths used by all the libraries in this file
# There is a windows specific include path for GNUTools support that is inside the repository. The
# equivalent support is already included for Linux and Android so is not required for those platforms
......@@ -137,7 +137,11 @@ if (WIN32)
set(Jitter_inc_dirs ${Jitter_inc_dirs} ${GNUTOOLS_DIR}/include)
endif (WIN32)
win_static_runtime()
if (LINK_AS_STATIC_LIB)
win_static_runtime()
else (LINK_AS_STATIC_LIB)
win_dynamic_runtime()
endif (LINK_AS_STATIC_LIB)
# Some Android specific paths primarily to enable support for STL
if(ANDROID AND MEDIA_IGA)
......
project(IGA_EXE)
# Set up windows mobile build flags to use dynamic multi-threaded runtime (/MD)
# Set up windows(other) build flags to use static multi-threaded runtime (/MT)
#
# This mimicks vISA/MDF configurations
win_static_runtime()
if (LINK_AS_STATIC_LIB)
win_static_runtime()
else (LINK_AS_STATIC_LIB)
win_dynamic_runtime()
endif (LINK_AS_STATIC_LIB)
set(IGA_EXE_CPP
${CMAKE_CURRENT_SOURCE_DIR}/assemble.cpp
......
......@@ -21,12 +21,11 @@ add_subdirectory(MemManager)
add_subdirectory(Models)
add_subdirectory(Timer)
# Set up windows mobile build flags to use dynamic multi-threaded runtime (/MD)
# Set up windows(other) build flags to use static multi-threaded runtime (/MT)
#
# This mimicks vISA/MDF configurations
win_static_runtime()
if (LINK_AS_STATIC_LIB)
win_static_runtime()
else (LINK_AS_STATIC_LIB)
win_dynamic_runtime()
endif (LINK_AS_STATIC_LIB)
# Mimick IGC/MDF warnings within IGA library on our side to ensure we don't
# break the build.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment