mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 06:39:14 +01:00
Merge pull request #4692 from Orphis/cmake_cleanup
CMake cleanups for Windows
This commit is contained in:
commit
b05fc9d369
@ -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)
|
||||
|
||||
|
||||
|
2
Externals/Bochs_disasm/CMakeLists.txt
vendored
2
Externals/Bochs_disasm/CMakeLists.txt
vendored
@ -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})
|
||||
|
11
Externals/glslang/CMakeLists.txt
vendored
11
Externals/glslang/CMakeLists.txt
vendored
@ -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})
|
||||
|
||||
|
12
Externals/libusb/CMakeLists.txt
vendored
12
Externals/libusb/CMakeLists.txt
vendored
@ -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)
|
||||
|
@ -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 <TARGET>")
|
||||
if(ENABLE_PCH)
|
||||
# This is actually a .h file, but trick cmake into compiling it as a source file
|
||||
|
Loading…
x
Reference in New Issue
Block a user