Skip to content
Snippets Groups Projects
Commit 9765d6e8 authored by Jerome Hue's avatar Jerome Hue
Browse files

Only define _USE_MATH_DEFINES on Windows platforms

The _USE_MATH_DEFINES macro is only needed on Windows to expose math
constants like M_PI in math.h/cmath.
parent eeded572
No related branches found
No related tags found
2 merge requests!166Update 0.5.0 -> 0.6.0,!146Implement a backward for Heaviside
Pipeline #68638 passed
...@@ -87,7 +87,9 @@ target_link_libraries(${module_name} ...@@ -87,7 +87,9 @@ target_link_libraries(${module_name}
) )
# Add definition _USE_MATH_DEFINES to enable math constant definitions from math.h/cmath. # Add definition _USE_MATH_DEFINES to enable math constant definitions from math.h/cmath.
target_compile_definitions(${module_name} PRIVATE _USE_MATH_DEFINES) if (WIN32)
target_compile_definitions(${module_name} PRIVATE _USE_MATH_DEFINES)
endif()
#Set target properties #Set target properties
set_property(TARGET ${module_name} PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET ${module_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
......
...@@ -21,7 +21,9 @@ file(GLOB_RECURSE src_files "*.cpp") ...@@ -21,7 +21,9 @@ file(GLOB_RECURSE src_files "*.cpp")
add_executable(tests${module_name} ${src_files}) add_executable(tests${module_name} ${src_files})
target_compile_definitions(tests${module_name} PRIVATE _USE_MATH_DEFINES) if (WIN32)
target_compile_definitions(tests${module_name} PRIVATE _USE_MATH_DEFINES)
endif()
target_link_libraries(tests${module_name} PRIVATE ${module_name}) target_link_libraries(tests${module_name} PRIVATE ${module_name})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment