Skip to content

Commit 1907a83

Browse files
committed
take 14
1 parent 39ff01a commit 1907a83

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

src/bin/libint/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ target_compile_definitions(
3939
libint-libcompiler
4040
PUBLIC
4141
__COMPILING_LIBINT2=1
42-
# MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined.
4342
$<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
43+
# MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined.
4444
)
4545

4646
target_compile_options(
4747
libint-libcompiler
4848
PUBLIC
49+
$<$<BOOL:${MSVC}>:/EHsc>
4950
# Set the exception handling model (allows "throw")
50-
$<$<BOOL:${MSVC}>:"/EHsc">
5151
)
5252

5353
target_compile_features(

src/lib/libint/CMakeLists.txt.export

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ list(LENGTH LIBINT2_LIBRARY_CXX_SRC _source_count)
173173
message(STATUS "Loading ${_source_count} library source files from LIBINT2_LIBRARY_CXX_SRC")
174174
message(DEBUG "LIBINT2_LIBRARY_CXX_SRC=${LIBINT2_LIBRARY_CXX_SRC}")
175175

176+
# Notes
177+
# * __COMPILING_LIBINT2 is needed whenever using libint targets in the build tree
178+
# * MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined
179+
# * /EHsc sets the exception handling model (allows "throw")
180+
176181
add_library(
177182
int-obj
178183
OBJECT
@@ -193,8 +198,7 @@ target_compile_features(
193198
set_target_properties(
194199
int-obj
195200
PROPERTIES
196-
UNITY_BUILD TRUE
197-
# always use unity build for int-obj
201+
UNITY_BUILD TRUE # always use unity build for int-obj
198202
)
199203
target_include_directories(
200204
int-obj
@@ -205,6 +209,16 @@ target_include_directories(
205209
${PROJECT_SOURCE_DIR}/include/libint2/
206210
)
207211

212+
if (MSVC)
213+
set_target_properties(
214+
int-obj
215+
PROPERTIES
216+
LINK_FLAGS "/STACK:4194304"
217+
# Increase stack size from 1 MB to 4 MB
218+
)
219+
endif()
220+
221+
208222
if (BUILD_SHARED_LIBS OR LIBINT2_BUILD_SHARED_AND_STATIC_LIBS)
209223
set(BUILD_SHARED_LIBS 1)
210224
set_target_properties(
@@ -233,13 +247,13 @@ if (BUILD_SHARED_LIBS)
233247
int-shared
234248
INTERFACE
235249
$<BUILD_INTERFACE:__COMPILING_LIBINT2=1>
236-
# need __COMPILING_LIBINT2 whenever using libint targets in the build tree
250+
PUBLIC
251+
$<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
237252
)
238-
239-
set_target_properties(
253+
target_compile_options(
240254
int-shared
241-
PROPERTIES
242-
OUTPUT_NAME "int2"
255+
PUBLIC
256+
$<$<BOOL:${MSVC}>:/EHsc>
243257
)
244258
target_include_directories(
245259
int-shared
@@ -249,7 +263,11 @@ if (BUILD_SHARED_LIBS)
249263
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
250264
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/libint2>
251265
)
252-
266+
set_target_properties(
267+
int-shared
268+
PROPERTIES
269+
OUTPUT_NAME "int2"
270+
)
253271
endif()
254272

255273
if (BUILD_STATIC_LIBS)
@@ -269,13 +287,11 @@ if (BUILD_STATIC_LIBS)
269287
INTERFACE
270288
$<BUILD_INTERFACE:__COMPILING_LIBINT2=1>
271289
PUBLIC
272-
# MSVC does not include <cmath> constants, unless _USE_MATH_DEFINES is defined.
273290
$<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
274291
)
275292
target_compile_options(
276293
int-static
277294
PUBLIC
278-
# Set the exception handling model (allows "throw")
279295
$<$<BOOL:${MSVC}>:/EHsc>
280296
)
281297
target_include_directories(
@@ -291,9 +307,6 @@ if (BUILD_STATIC_LIBS)
291307
PROPERTIES
292308
OUTPUT_NAME "int2"
293309
)
294-
295-
296-
# target_compile_definitions(int-static PUBLIC _USE_MATH_DEFINES)
297310
endif()
298311

299312
# Permanent aliases =============================================================

0 commit comments

Comments
 (0)