forked from microsoft/compiler-tests
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
25 lines (21 loc) · 958 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cmake_minimum_required(VERSION 3.12)
project(compiler-tests)
# Set the source files
file(GLOB SOURCES "src/*.c")
file(GLOB CXX_SOURCES "eh/*.cpp")
# Iterate over each source file and create an EXE
foreach(SOURCE_FILE ${SOURCES})
get_filename_component(FILE_NAME ${SOURCE_FILE} NAME_WE)
add_executable(${FILE_NAME} ${SOURCE_FILE})
target_include_directories(${FILE_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/inc)
target_compile_options(${FILE_NAME} PRIVATE "/GL" "/GS")
target_link_options(${FILE_NAME} PRIVATE "/DEBUG:FULL")
endforeach()
# Iterate over each source file and create an EXE
foreach(SOURCE_FILE ${CXX_SOURCES})
get_filename_component(FILE_NAME ${SOURCE_FILE} NAME_WE)
add_executable(${FILE_NAME} ${SOURCE_FILE})
target_compile_options(${FILE_NAME} PRIVATE "/GL" "/GS")
target_link_options(${FILE_NAME} PRIVATE "/DEBUG:FULL")
endforeach()
STRING (REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")