Skip to content

Commit f56f892

Browse files
mbarbierMarc-Pierre-Barbier
mbarbier
authored andcommitted
Fix CGAL build with ICPC
The original code was adding "-fp-model strict" to all targets Regardless of the language which led to compilation issues with CMake Project that contained CUDA or C code (untesed with C). Change fp-model strict to fp-model=strict for more compatibility with Wrappers like nvcc. Relevant intel doc: https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/fp-model-fp.html
1 parent 52a6b2e commit f56f892

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

recipes/cgal/all/conanfile.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,18 @@ def _create_cmake_module_variables(self, module_file):
135135
endif()
136136
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
137137
message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
138-
if(WIN32)
139-
target_compile_options(${target} INTERFACE "/fp:strict")
138+
if(CMAKE_VERSION VERSION_LESS 3.3)
139+
if(WIN32)
140+
target_compile_options(${target} INTERFACE "/fp:strict")
141+
else()
142+
target_compile_options(${target} INTERFACE "-fp-model=strict")
143+
endif()
140144
else()
141-
target_compile_options(${target} INTERFACE "-fp-model" "strict")
145+
if(WIN32)
146+
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:/fp:strict>")
147+
else()
148+
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-fp-model=strict>")
149+
endif()
142150
endif()
143151
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
144152
message( STATUS "Using SunPro compiler, using STLPort 4." )

0 commit comments

Comments
 (0)