diff --git a/src/bin/libint/CMakeLists.txt b/src/bin/libint/CMakeLists.txt index f9b82c565..532a6da97 100644 --- a/src/bin/libint/CMakeLists.txt +++ b/src/bin/libint/CMakeLists.txt @@ -39,15 +39,15 @@ target_compile_definitions( libint-libcompiler PUBLIC __COMPILING_LIBINT2=1 - # MSVC does not include constants, unless _USE_MATH_DEFINES is defined. $<$:_USE_MATH_DEFINES> + # MSVC does not include constants, unless _USE_MATH_DEFINES is defined. ) target_compile_options( libint-libcompiler PUBLIC + $<$:/EHsc> # Set the exception handling model (allows "throw") - $<$:"/EHsc"> ) target_compile_features( diff --git a/src/lib/libint/CMakeLists.txt.export b/src/lib/libint/CMakeLists.txt.export index f67d4b6c8..48c42d0eb 100644 --- a/src/lib/libint/CMakeLists.txt.export +++ b/src/lib/libint/CMakeLists.txt.export @@ -173,6 +173,11 @@ list(LENGTH LIBINT2_LIBRARY_CXX_SRC _source_count) message(STATUS "Loading ${_source_count} library source files from LIBINT2_LIBRARY_CXX_SRC") message(DEBUG "LIBINT2_LIBRARY_CXX_SRC=${LIBINT2_LIBRARY_CXX_SRC}") +# Notes +# * __COMPILING_LIBINT2 is needed whenever using libint targets in the build tree +# * MSVC does not include constants, unless _USE_MATH_DEFINES is defined +# * /EHsc sets the exception handling model (allows "throw") + add_library( int-obj OBJECT @@ -193,8 +198,7 @@ target_compile_features( set_target_properties( int-obj PROPERTIES - UNITY_BUILD TRUE - # always use unity build for int-obj + UNITY_BUILD TRUE # always use unity build for int-obj ) target_include_directories( int-obj @@ -205,6 +209,16 @@ target_include_directories( ${PROJECT_SOURCE_DIR}/include/libint2/ ) +if (MSVC) + set_target_properties( + int-obj + PROPERTIES + LINK_FLAGS "/STACK:4194304" + # Increase stack size from 1 MB to 4 MB + ) +endif() + + if (BUILD_SHARED_LIBS OR LIBINT2_BUILD_SHARED_AND_STATIC_LIBS) set(BUILD_SHARED_LIBS 1) set_target_properties( @@ -233,13 +247,13 @@ if (BUILD_SHARED_LIBS) int-shared INTERFACE $ - # need __COMPILING_LIBINT2 whenever using libint targets in the build tree + PUBLIC + $<$:_USE_MATH_DEFINES> ) - - set_target_properties( + target_compile_options( int-shared - PROPERTIES - OUTPUT_NAME "int2" + PUBLIC + $<$:/EHsc> ) target_include_directories( int-shared @@ -249,7 +263,11 @@ if (BUILD_SHARED_LIBS) $ $ ) - + set_target_properties( + int-shared + PROPERTIES + OUTPUT_NAME "int2" + ) endif() if (BUILD_STATIC_LIBS) @@ -269,13 +287,11 @@ if (BUILD_STATIC_LIBS) INTERFACE $ PUBLIC - # MSVC does not include constants, unless _USE_MATH_DEFINES is defined. $<$:_USE_MATH_DEFINES> ) target_compile_options( int-static PUBLIC - # Set the exception handling model (allows "throw") $<$:/EHsc> ) target_include_directories( @@ -291,9 +307,6 @@ if (BUILD_STATIC_LIBS) PROPERTIES OUTPUT_NAME "int2" ) - - -# target_compile_definitions(int-static PUBLIC _USE_MATH_DEFINES) endif() # Permanent aliases =============================================================