Skip to content

Commit

Permalink
set missing cmake variables
Browse files Browse the repository at this point in the history
set `CMAKE_C_COMPILER_AR`, `CMAKE_CXX_COMPILER_AR`, `CMAKE_C_COMPILER_RANLIB`, `CMAKE_CXX_COMPILER_RANLIB`
when they are not set yet
  • Loading branch information
maxbachmann authored Dec 3, 2022
1 parent 9ef4ab6 commit fe82774
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ include(CMakePrintHelpers)
cmake_print_variables(CMAKE_AR CMAKE_C_COMPILER_AR CMAKE_CXX_COMPILER_AR)
cmake_print_variables(CMAKE_RANLIB CMAKE_C_COMPILER_RANLIB CMAKE_CXX_COMPILER_RANLIB)

if ("${CMAKE_C_COMPILER_AR}" STREQUAL "")
set(CMAKE_C_COMPILER_AR "${CMAKE_AR}")
endif()
if ("${CMAKE_CXX_COMPILER_AR}" STREQUAL "")
set(CMAKE_CXX_COMPILER_AR "${CMAKE_AR}")
endif()
if ("${CMAKE_C_COMPILER_RANLIB}" STREQUAL "")
set(CMAKE_C_COMPILER_RANLIB "${CMAKE_RANLIB}")
endif()
if ("${CMAKE_CXX_COMPILER_RANLIB}" STREQUAL "")
set(CMAKE_CXX_COMPILER_RANLIB "${CMAKE_RANLIB}")
endif()

if(MSVC)
add_compile_options(/W4 /bigobj)
else()
Expand Down

0 comments on commit fe82774

Please sign in to comment.