CMake: Remove _RAYLIB suffix from -D{SHARED,STATIC}_RAYLIB
They were named so for compatibility with make, but make doesn't use the anymore. I always forget whether it's SHARED_RAYLIB or RAYLIB_SHARED... For now, RAYLIB_SHARED and STATIC_RAYLIB may still be used, but print a deprecation warning.
This commit is contained in:
parent
36750ffb9a
commit
051040af2d
@ -45,7 +45,7 @@ before_install:
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON -DUSE_EXTERNAL_GLFW=IF_POSSIBLE ..
|
||||
- cmake -DMACOS_FATLIB=ON -DSTATIC=ON -DSHARED=ON -DBUILD_EXAMPLES=ON -DBUILD_GAMES=ON -DUSE_EXTERNAL_GLFW=IF_POSSIBLE ..
|
||||
- make VERBOSE=1
|
||||
- make package
|
||||
|
||||
|
@ -39,7 +39,7 @@ before_build:
|
||||
- cd build
|
||||
|
||||
build_script:
|
||||
- cmake -G %GENERATOR% -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% ..
|
||||
- cmake -G %GENERATOR% -DSTATIC=ON -DSHARED=ON -DBUILD_EXAMPLES=%examples% -DBUILD_GAMES=%examples% ..
|
||||
- cmake --build . --target install
|
||||
|
||||
after_build:
|
||||
|
@ -10,12 +10,21 @@ set(RAYLIB raylib) # Name of the generated library
|
||||
# Shared library is always PIC. Static library should be PIC too if linked into a shared library
|
||||
set(WITH_PIC OFF CACHE BOOL "Compile static library as position-independent code" OFF)
|
||||
# Build a static and/or shared raylib?
|
||||
set(SHARED_RAYLIB OFF CACHE BOOL "Build raylib as a dynamic library")
|
||||
set(STATIC_RAYLIB ON CACHE BOOL "Build raylib as a static library")
|
||||
set(SHARED OFF CACHE BOOL "Build raylib as a dynamic library")
|
||||
set(STATIC ON CACHE BOOL "Build raylib as a static library")
|
||||
set(MACOS_FATLIB ON CACHE BOOL "Build fat library for both i386 and x86_64 on macOS")
|
||||
|
||||
if(NOT (STATIC_RAYLIB OR SHARED_RAYLIB))
|
||||
message(FATAL_ERROR "Nothing to do if both -DSHARED_RAYLIB=OFF and -DSTATIC_RAYLIB=OFF...")
|
||||
if(NOT (STATIC OR SHARED))
|
||||
message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...")
|
||||
endif()
|
||||
|
||||
if(DEFINED SHARED_RAYLIB)
|
||||
set(SHARED ${SHARED_RAYLIB})
|
||||
message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.")
|
||||
endif()
|
||||
if(DEFINED STATIC_RAYLIB)
|
||||
set(STATIC ${STATIC_RAYLIB})
|
||||
message(DEPRECATION "-DSTATIC_RAYLIB is deprecated. Please use -DSTATIC instead.")
|
||||
endif()
|
||||
|
||||
# Platform
|
||||
@ -85,7 +94,7 @@ endif()
|
||||
|
||||
if(MACOS_FATLIB)
|
||||
if (CMAKE_OSX_ARCHITECTURES)
|
||||
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides BUILD_MACOS_FATLIB=ON")
|
||||
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON")
|
||||
else()
|
||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
|
||||
endif()
|
||||
@ -94,7 +103,7 @@ endif()
|
||||
# Which platform?
|
||||
if(${PLATFORM} MATCHES "PLATFORM_DESKTOP")
|
||||
|
||||
if(${SHARED_RAYLIB})
|
||||
if(${SHARED})
|
||||
add_library(${RAYLIB}_shared SHARED ${sources})
|
||||
|
||||
target_compile_definitions(${RAYLIB}_shared
|
||||
@ -127,9 +136,9 @@ if(${PLATFORM} MATCHES "PLATFORM_DESKTOP")
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
endif()
|
||||
endif(${SHARED_RAYLIB})
|
||||
endif(${SHARED})
|
||||
|
||||
if(${STATIC_RAYLIB})
|
||||
if(${STATIC})
|
||||
add_library(${RAYLIB} STATIC ${sources})
|
||||
|
||||
target_compile_definitions(${RAYLIB}
|
||||
@ -147,7 +156,7 @@ if(${PLATFORM} MATCHES "PLATFORM_DESKTOP")
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
endif(${STATIC_RAYLIB})
|
||||
endif(${STATIC})
|
||||
|
||||
configure_file(../raylib.pc.in raylib.pc @ONLY)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/release/raylib.pc DESTINATION lib/pkgconfig)
|
||||
|
Loading…
Reference in New Issue
Block a user