aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Neto <dneto@google.com>2018-11-19 22:02:07 -0500
committerGitHub <noreply@github.com>2018-11-19 22:02:07 -0500
commite390591a28e042872376b9db4de5433b15702c02 (patch)
tree51fdfcf68fc853d3118cb9a3573b2f1b64190b30 /src/CMakeLists.txt
parent6296cc53f4608ee06fff0d57a6b266c541f0ca7a (diff)
downloadamber-e390591a28e042872376b9db4de5433b15702c02.tar.gz
Windows build support (#71)
Windows build support * MSVC: Ensure CRT is statically linked into executables * Use fopen_s on Windows to avoid security warning * Use std::strtoull and include its header * Use #if defined(_MSC_VER)
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bc1567a..854a4d2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -55,7 +55,10 @@ add_library(libamber ${AMBER_SOURCES})
amber_default_compile_options(libamber)
set_target_properties(libamber PROPERTIES OUTPUT_NAME "amber")
# TODO(dsinclair): Remove pthread when building on windows.
-target_link_libraries(libamber SPIRV-Tools shaderc SPIRV pthread)
+target_link_libraries(libamber SPIRV-Tools shaderc SPIRV)
+if (NOT MSVC)
+ target_link_libraries(libamber pthread)
+endif()
if (${Vulkan_FOUND})
target_link_libraries(libamber libamberenginevulkan)
@@ -86,8 +89,11 @@ if (${Vulkan_FOUND})
endif()
add_executable(amber_unittests ${TEST_SRCS})
-target_compile_options(amber_unittests PRIVATE
- -Wno-global-constructors)
+
+if (NOT MSVC)
+ target_compile_options(amber_unittests PRIVATE
+ -Wno-global-constructors)
+endif()
target_include_directories(amber_unittests PRIVATE
${gtest_SOURCE_DIR}/include)