|
@@ -809,20 +809,20 @@ if (LIBCXX_NEEDS_SITE_CONFIG)
|
|
|
configure_file("include/__config_site.in"
|
|
|
"${site_config_path}"
|
|
|
@ONLY)
|
|
|
+elseif(EXISTS "${site_config_path}")
|
|
|
+ message(STATUS "Removing stale site configuration ${site_config_path}")
|
|
|
+ file(REMOVE "${site_config_path}")
|
|
|
+endif()
|
|
|
|
|
|
- # Provide the config definitions by included the generated __config_site
|
|
|
- # file at compile time.
|
|
|
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
|
|
|
- add_compile_flags("/FI\"${LIBCXX_BINARY_DIR}/__config_site\"")
|
|
|
- else()
|
|
|
- add_compile_flags("-include ${LIBCXX_BINARY_DIR}/__config_site")
|
|
|
- endif()
|
|
|
-else()
|
|
|
- if (EXISTS "${site_config_path}")
|
|
|
- message(STATUS "Removing stale site configuration ${site_config_path}")
|
|
|
- file(REMOVE "${site_config_path}")
|
|
|
+function(cxx_add_config_site target)
|
|
|
+ if (LIBCXX_NEEDS_SITE_CONFIG)
|
|
|
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
|
|
|
+ target_compile_options(${target} PUBLIC "/FI\"${site_config_path}\"")
|
|
|
+ else()
|
|
|
+ target_compile_options(${target} PUBLIC "-include${site_config_path}")
|
|
|
+ endif()
|
|
|
endif()
|
|
|
-endif()
|
|
|
+endfunction()
|
|
|
|
|
|
#===============================================================================
|
|
|
# Setup Source Code And Tests
|