1# ~~~ 2# Copyright (c) 2021 Valve Corporation 3# Copyright (c) 2021 LunarG, Inc. 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16# ~~~ 17 18add_library(shim-common STATIC shim_common.cpp) 19target_link_libraries(shim-common PUBLIC testing_framework_util) 20target_include_directories(shim-common PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) 21set_target_properties(shim-common ${LOADER_STANDARD_CXX_PROPERTIES}) 22 23if (WIN32) 24 # need adapters.h which is in the loader folder 25 target_include_directories(shim-common PUBLIC ${CMAKE_SOURCE_DIR}/loader) 26 target_link_libraries(shim-common PRIVATE cfgmgr32) 27 28 add_library(shim-library SHARED windows_shim.cpp) 29 target_link_libraries(shim-library PRIVATE detours cfgmgr32) 30 31elseif(UNIX) 32 if(APPLE) 33 add_library(shim-library SHARED unix_shim.cpp) 34 else() 35 add_library(shim-library STATIC unix_shim.cpp) 36 endif() 37endif() 38#common attributes 39target_link_libraries(shim-library PUBLIC shim-common) 40set_target_properties(shim-library ${LOADER_STANDARD_CXX_PROPERTIES}) 41