Skip to content

Commit 310e3bd

Browse files
authored
Fix handling of /EHsc and /MP flags (AcademySoftwareFoundation#2021)
These flags are now specified via a generator expression, so they are only applied to C++ compilation, not CUDA. This also makes the flags PRIVATE, not PUBLIC. They should not affect dependant projects, so they should not be a part of the public interface. Resolves AcademySoftwareFoundation#2018 Signed-off-by: Cary Phillips <[email protected]>
1 parent d5b059d commit 310e3bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmake/LibraryDefine.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function(OPENEXR_DEFINE_LIBRARY libname)
1010
cmake_parse_arguments(OPENEXR_CURLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
1111

1212
if (MSVC)
13-
set(_openexr_extra_flags "/EHsc" "/MP")
13+
set(_openexr_extra_flags "$<$<COMPILE_LANGUAGE:CXX>:/EHsc>" "$<$<COMPILE_LANGUAGE:CXX>:/MP>")
1414
endif()
1515
set(objlib ${libname})
1616
add_library(${objlib}
@@ -59,7 +59,7 @@ function(OPENEXR_DEFINE_LIBRARY libname)
5959
target_compile_definitions(${objlib} PUBLIC OPENEXR_USE_DEFAULT_VISIBILITY)
6060
endif()
6161
if (_openexr_extra_flags)
62-
target_compile_options(${objlib} PUBLIC ${_openexr_extra_flags})
62+
target_compile_options(${objlib} PRIVATE ${_openexr_extra_flags})
6363
endif()
6464
set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS})
6565

0 commit comments

Comments
 (0)