Skip to content

Commit 5d4ebe7

Browse files
wpangfxbot
authored andcommitted
Use an option to control /MT or /MD
Change-Id: I157c75b583028d3f737123bce103aebf2b345c1e
1 parent 49497e5 commit 5d4ebe7

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

visa/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ set(LINK_DLL_IGA 1)
3434
endif(IGC_BUILD)
3535

3636

37+
# Set up build flags to use dynamic multi-threaded runtime (/MD) or
38+
# to use static multi-threaded runtime (/MT)
39+
option(LINK_AS_STATIC_LIB "link with /MT or /MD" ON)
40+
3741

3842
################################################################################
3943
# IGA Related
@@ -125,10 +129,6 @@ BISON_TARGET(CISAParser CISA.y ${CMAKE_CURRENT_BINARY_DIR}/CISA.tab.c COMPILE_FL
125129
FLEX_TARGET(CISAScanner CISA.l ${CMAKE_CURRENT_BINARY_DIR}/lex.CISA.c COMPILE_FLAGS "-PCISA ${WIN_FLEX_FLAG}")
126130
ADD_FLEX_BISON_DEPENDENCY(CISAScanner CISAParser)
127131

128-
# Set up windows mobile build flags to use dynamic multi-threaded runtime (/MD)
129-
# Set up windows(other) build flags to use static multi-threaded runtime (/MT)
130-
131-
132132
# Set up include paths used by all the libraries in this file
133133
# There is a windows specific include path for GNUTools support that is inside the repository. The
134134
# equivalent support is already included for Linux and Android so is not required for those platforms
@@ -137,7 +137,11 @@ if (WIN32)
137137
set(Jitter_inc_dirs ${Jitter_inc_dirs} ${GNUTOOLS_DIR}/include)
138138
endif (WIN32)
139139

140-
win_static_runtime()
140+
if (LINK_AS_STATIC_LIB)
141+
win_static_runtime()
142+
else (LINK_AS_STATIC_LIB)
143+
win_dynamic_runtime()
144+
endif (LINK_AS_STATIC_LIB)
141145

142146
# Some Android specific paths primarily to enable support for STL
143147
if(ANDROID AND MEDIA_IGA)

visa/iga/IGAExe/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
project(IGA_EXE)
2-
# Set up windows mobile build flags to use dynamic multi-threaded runtime (/MD)
3-
# Set up windows(other) build flags to use static multi-threaded runtime (/MT)
4-
#
5-
# This mimicks vISA/MDF configurations
6-
win_static_runtime()
72

3+
if (LINK_AS_STATIC_LIB)
4+
win_static_runtime()
5+
else (LINK_AS_STATIC_LIB)
6+
win_dynamic_runtime()
7+
endif (LINK_AS_STATIC_LIB)
88

99
set(IGA_EXE_CPP
1010
${CMAKE_CURRENT_SOURCE_DIR}/assemble.cpp

visa/iga/IGALibrary/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ add_subdirectory(MemManager)
2121
add_subdirectory(Models)
2222
add_subdirectory(Timer)
2323

24-
# Set up windows mobile build flags to use dynamic multi-threaded runtime (/MD)
25-
# Set up windows(other) build flags to use static multi-threaded runtime (/MT)
26-
#
27-
# This mimicks vISA/MDF configurations
28-
29-
win_static_runtime()
24+
if (LINK_AS_STATIC_LIB)
25+
win_static_runtime()
26+
else (LINK_AS_STATIC_LIB)
27+
win_dynamic_runtime()
28+
endif (LINK_AS_STATIC_LIB)
3029

3130
# Mimick IGC/MDF warnings within IGA library on our side to ensure we don't
3231
# break the build.

0 commit comments

Comments
 (0)