Skip to content

Commit

Permalink
Merge pull request #276 from paullouisageneau/fix-static-define
Browse files Browse the repository at this point in the history
CMake: Fix JUICE_STATIC define when BUILD_SHARED_LIBS=OFF
  • Loading branch information
paullouisageneau authored Oct 22, 2024
2 parents 51a579d + 7836695 commit c4f1d41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ target_include_directories(juice-static PUBLIC
target_include_directories(juice-static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/juice)
target_include_directories(juice-static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_compile_definitions(juice-static PRIVATE $<$<CONFIG:Release>:RELEASE=1>)
target_compile_definitions(juice-static PUBLIC JUICE_STATIC)
target_link_libraries(juice-static PRIVATE Threads::Threads)

if(WIN32)
Expand Down Expand Up @@ -185,7 +184,11 @@ install(FILES

set_target_properties(juice PROPERTIES C_VISIBILITY_PRESET hidden)
target_compile_definitions(juice PRIVATE JUICE_EXPORTS)
if (NOT BUILD_SHARED_LIBS)
target_compile_definitions(juice PUBLIC JUICE_STATIC)
endif()
target_compile_definitions(juice-static PRIVATE JUICE_EXPORTS)
target_compile_definitions(juice-static PUBLIC JUICE_STATIC)

if(NOT MSVC)
target_compile_options(juice PRIVATE -Wall -Wextra)
Expand Down

0 comments on commit c4f1d41

Please sign in to comment.