mirror of
https://github.com/libsdl-org/SDL.git
synced 2024-11-26 21:33:26 +08:00
cmake: only use precompile headers for C and CXX
This commit is contained in:
parent
7d55bbc0da
commit
683411e96f
@ -3126,6 +3126,9 @@ if(APPLE)
|
||||
if(FILE_EXTENSION STREQUAL ".m")
|
||||
set_property(SOURCE ${SOURCE_FILE} APPEND_STRING PROPERTY COMPILE_FLAGS " -x objective-c")
|
||||
endif()
|
||||
if(NOT FILE_EXTENSION STREQUAL ".c" AND NOT FILE_EXTENSION STREQUAL ".cpp")
|
||||
set_property(SOURCE ${SOURCE_FILE} PROPERTY SKIP_PRECOMPILE_HEADERS 1)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@ -3254,7 +3257,7 @@ if(SDL_SHARED)
|
||||
set_property(TARGET SDL3-shared APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
|
||||
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
|
||||
target_precompile_headers(SDL3-shared PRIVATE "${PROJECT_SOURCE_DIR}/src/SDL_internal.h")
|
||||
target_precompile_headers(SDL3-shared PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -3296,7 +3299,7 @@ if(SDL_STATIC)
|
||||
set_property(TARGET SDL3-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
|
||||
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
|
||||
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
|
||||
target_precompile_headers(SDL3-static PRIVATE "${PROJECT_SOURCE_DIR}/src/SDL_internal.h")
|
||||
target_precompile_headers(SDL3-static PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user