diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a167ab78c28..81c1304ad6f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1057,16 +1057,6 @@ enable_testing() add_custom_target(unittests) add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND}) - -######################################## -# Start compiling our code -# -add_definitions(-std=c++1y) - -# These aren't actually needed for C11/C++11 -# but some dependencies require them (LLVM, libav). -add_definitions(-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS) - add_subdirectory(Source) diff --git a/Externals/Bochs_disasm/CMakeLists.txt b/Externals/Bochs_disasm/CMakeLists.txt index 3d93e7e6e916..505f7521331a 100644 --- a/Externals/Bochs_disasm/CMakeLists.txt +++ b/Externals/Bochs_disasm/CMakeLists.txt @@ -4,7 +4,7 @@ set(SRCS dis_decode.cc syntax.cc) if(WIN32) - set(SRCS ${SRCS} stdafx.cpp) + set(SRCS ${SRCS} stdafx.cc) endif(WIN32) add_library(bdisasm STATIC ${SRCS}) diff --git a/Externals/glslang/CMakeLists.txt b/Externals/glslang/CMakeLists.txt index 4ea45b5906ff..8b8fb5180e9b 100644 --- a/Externals/glslang/CMakeLists.txt +++ b/Externals/glslang/CMakeLists.txt @@ -27,7 +27,7 @@ set(SRCS glslang/MachineIndependent/ShaderLang.cpp glslang/MachineIndependent/SymbolTable.cpp glslang/MachineIndependent/Versions.cpp - glslang/OSDependent/Unix/ossource.cpp + hlsl/hlslGrammar.cpp hlsl/hlslOpMap.cpp hlsl/hlslParseables.cpp @@ -44,6 +44,13 @@ set(SRCS SPIRV/SPVRemapper.cpp ) +if(WIN32) + list(APPEND SRCS glslang/OSDependent/Windows/ossource.cpp) +else() + list(APPEND SRCS glslang/OSDependent/Unix/ossource.cpp) +endif() + +if(NOT MSVC) # glslang requires C++11 at a minimum to compile. add_definitions(-std=c++11) @@ -53,6 +60,6 @@ add_definitions(-Wno-reorder) add_definitions(-Wno-sign-compare) add_definitions(-Wno-parentheses) add_definitions(-Wno-unused-variable) +endif() add_library(glslang STATIC ${SRCS}) - diff --git a/Externals/libusb/CMakeLists.txt b/Externals/libusb/CMakeLists.txt index fe8c236140e0..84754f1130a9 100644 --- a/Externals/libusb/CMakeLists.txt +++ b/Externals/libusb/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(usb SHARED EXCLUDE_FROM_ALL +add_library(usb STATIC EXCLUDE_FROM_ALL libusb/core.c libusb/core.c libusb/descriptor.c @@ -8,6 +8,9 @@ add_library(usb SHARED EXCLUDE_FROM_ALL libusb/sync.c ) set_target_properties(usb PROPERTIES VERSION 1.0.19) +if(WIN32) + target_include_directories(usb BEFORE PUBLIC libusb PRIVATE msvc) +else() target_include_directories(usb # turns out other projects also have "config.h", so make sure the # LibUSB one comes first @@ -16,9 +19,14 @@ target_include_directories(usb PUBLIC libusb PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" ) +endif() if(WIN32 OR CYGWIN) - target_sources(usb PRIVATE libusb/os/windows_usb.c) + target_sources(usb PRIVATE + libusb/os/threads_windows.c + libusb/os/windows_winusb.c + libusb/os/windows_nt_common.c + ) set(OS_WINDOWS TRUE) elseif(APPLE) target_sources(usb PRIVATE libusb/os/darwin_usb.c) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 2cc8c77c129b..46f2a9c9ccfd 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -1,3 +1,13 @@ +check_and_add_flag(CXX14 -std=c++14) +if(NOT FLAG_CXX_CXX14) + check_and_add_flag(HAS_CXX1Y -std=c++1y) +endif() + +# These aren't actually needed for C11/C++11 +# but some dependencies require them (LLVM, libav). +add_definitions(-D__STDC_LIMIT_MACROS) +add_definitions(-D__STDC_CONSTANT_MACROS) + set(CMAKE_FAKELANG_CREATE_STATIC_LIBRARY "touch ") if(ENABLE_PCH) # This is actually a .h file, but trick cmake into compiling it as a source file