Skip to content

Commit

Permalink
cmake: use options/defns rather than direct vars
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Nov 10, 2023
1 parent ad83198 commit cf15f46
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ if (APPLE)
endif()

if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP24")
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:_CRT_SECURE_NO_WARNINGS>")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/MP24>")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-fPIC>")
endif()

set(CMAKE_CXX_STANDARD 14)
Expand Down Expand Up @@ -211,8 +211,8 @@ list(APPEND NGP_INCLUDE_DIRECTORIES

find_package(OpenMP)
if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${OpenMP_C_FLAGS}>")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${OpenMP_CXX_FLAGS}>")
endif()

if (NGP_BUILD_WITH_OPTIX)
Expand Down

0 comments on commit cf15f46

Please sign in to comment.