Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed Feb 9, 2024
1 parent f92fa97 commit 741a78a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake")

# option to enable precompiled headers
sfml_set_option(SFML_ENABLE_PCH FALSE BOOL "TRUE to enable precompiled headers for SFML builds -- only supported on Windows/Linux")

if(SFML_ENABLE_PCH AND SFML_OS_MACOS)
message(FATAL_ERROR "Precompiled headers are currently not supported in macOS builds")
endif()

if(SFML_ENABLE_PCH AND BUILD_SHARED_LIBS)
# required to make the PCH consistent between all targets
# must appear before subdirectories are addded to take effect
add_definitions(-DSFML_SYSTEM_EXPORTS)

if(MSVC)
add_definitions(-D_WINDLL)
endif()
endif()

# add the subdirectories
Expand Down Expand Up @@ -257,6 +254,13 @@ if(SFML_INSTALL_PKGCONFIG_FILES)
endforeach()
endif()

# option to enable precompiled headers
sfml_set_option(SFML_ENABLE_PCH FALSE BOOL "TRUE to enable precompiled headers for SFML builds -- only supported on Windows/Linux and for static library builds")

if(SFML_ENABLE_PCH AND SFML_OS_MACOS)
message(FATAL_ERROR "Precompiled headers are currently not supported in macOS builds")
endif()

# setup the install rules
if(NOT SFML_BUILD_FRAMEWORKS)
install(DIRECTORY include/
Expand Down

0 comments on commit 741a78a

Please sign in to comment.