aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2016-02-12 16:39:20 -0700
committerJon Ashburn <jon@lunarg.com>2016-02-18 14:46:20 -0700
commite9821fbe3ecbd6b3a9cda927f3ec1f73828378e4 (patch)
tree973e688b351e1c6ddd7bfb66c61ab3d4a728b585
parent2e43b0a0f945a69825af1eee3cfb9377eb468cb7 (diff)
downloadusermoji-e9821fbe3ecbd6b3a9cda927f3ec1f73828378e4.tar.xz
loader:Force Cmake to build dev_ext_trampoline.c always relase mode
This makes sure this file always has tail call optimizations occuring
-rw-r--r--loader/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 835c23aa..16300729 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -34,14 +34,18 @@ set(LOADER_SRCS
if (WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
+ # build dev_ext_trampoline with release flags to allow tail-call optimization
+ # cmake and MSVC doesn't make this easy to do
+ set_source_files_properties(${LOADER_SRCS} PROPERTIES COMPILE_FLAGS ${CMAKE_C_FLAGS_DEBUG})
+ set(CMAKE_C_FLAGS_DEBUG "")
+ set_source_files_properties(dev_ext_trampoline.c PROPERTIES COMPILE_FLAGS ${CMAKE_C_FLAGS_RELEASE})
add_library(vulkan-${MAJOR} SHARED ${LOADER_SRCS} dirent_on_windows.c ${CMAKE_CURRENT_BINARY_DIR}/vulkan-${MAJOR}.def)
set_target_properties(vulkan-${MAJOR} PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/vulkan-${MAJOR}.def")
add_library(VKstatic.${MAJOR} STATIC ${LOADER_SRCS} dirent_on_windows.c)
set_target_properties(VKstatic.${MAJOR} PROPERTIES OUTPUT_NAME VKstatic.${MAJOR})
target_link_libraries(vulkan-${MAJOR} shlwapi)
-endif()
-if (NOT WIN32)
+else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith")
add_library(vulkan SHARED ${LOADER_SRCS})