Refactor compile flags

This commit is contained in:
Drew Galbraith 2023-06-07 11:09:27 -07:00
parent 010e261dc7
commit 6f81520918
5 changed files with 21 additions and 24 deletions

View file

@ -1,6 +1,3 @@
set(_COMPILE_FLAGS "-ffreestanding -fno-exceptions -mgeneral-regs-only")
set(_LINK_FLAGS "-nostdlib")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
add_executable(test
@ -12,19 +9,19 @@ target_link_libraries(test
set_target_properties(test
PROPERTIES
COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${_COMPILE_FLAGS}"
LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${_LINK_FLAGS}"
COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILE_FLAGS}"
LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${BASE_LINK_FLAGS}"
)
add_executable(test2
test2.cpp)
target_link_libraries(test2
libcxx
cxx
mammoth_lib)
set_target_properties(test2
PROPERTIES
COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${_COMPILE_FLAGS}"
LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${_LINK_FLAGS}"
COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILE_FLAGS}"
LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${BASE_LINK_FLAGS}"
)