Skip to content

Commit

Permalink
Merge pull request #142 from AntonShalgachev/respect-cmake-configurat…
Browse files Browse the repository at this point in the history
…ion-types

Don't overwrite CMake configuration types if yyjson is used as a dependency
  • Loading branch information
ibireme authored Oct 15, 2023
2 parents 88fd76f + af0f7e0 commit 5128fc3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ project(yyjson VERSION 0.8.0 LANGUAGES C)

# ------------------------------------------------------------------------------
# Build Type
if(XCODE OR MSVC)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
endif()
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to: Release")
set(CMAKE_BUILD_TYPE Release)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
if(XCODE OR MSVC)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
endif()
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to: Release")
set(CMAKE_BUILD_TYPE Release)
endif()
endif()


Expand Down

0 comments on commit 5128fc3

Please sign in to comment.